[OpenSER-Devel] returning 0 from function
Dan Pascu
dan at ag-projects.com
Mon Mar 3 10:19:28 CET 2008
On Monday 03 March 2008, Juha Heinanen wrote:
> Daniel-Constantin Mierla writes:
> > perhaps going to clear return codes handling will be better. Since
> > the beginning of ser, the meaning of return codes was:
> > - greater than 0 was considered true
> > - less than 0 was considered false
> > - 0 was considered exit.
> >
> > Now it is about backward compatibility on a hand and clear and
> > better understanding return code handling on the other hand. Perhaps
> > a debate on devel/users will make decision easier.
>
> my vote is to remove the "0 equals exit" option.
My guess is that this will not be easy to do as there are currently
functions that rely on this to stop processing the message and they do so
based on some internal checks/conditions that are not testable from the
script. Besides I personally do not want to fill up my script with lots
of checks after each function call, just to find out if I'm to continue
or not. For this reason, I believe that a return value that indicates
that the processing should stop there is necessary. Should that not be 0
because 0 is such a common value that may be useful to return from
functions, that is a different story.
--
Dan
More information about the Devel
mailing list