[Asterisk-Dev] asterisk functions return codes
Timur V. Elzhov
Timur.Elzhov at jinr.ru
Fri Aug 5 07:48:42 MST 2005
On Thu, Aug 04, 2005 at 09:13:30AM -0500, Kevin P. Fleming wrote:
> >However, when file is non-existent, it returns -1, so the *first*
> >condition will be true, and second will be false. So the right way
> >I guess is to write
> >
> > if (asterisk_fileexists(...) > 0)
>
> This is basic C understanding; there is no need for an operator here.
Really? I tried asterisk_fileexists(char *fn, ...), and found it returns 2
when file does exist, and -1 when it does not. So what way would you suggest
to write the above condition without an operator? :-)
--
Best regards,
Timur Elzhov
More information about the asterisk-dev
mailing list