apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: advice on use of APR_STATUS_IS_*
Date Mon, 09 May 2005 10:50:28 GMT
On Sun, May 08, 2005 at 05:51:48PM -0500, Randy Kobes wrote:
> mod_perl 2 supplies some APR::* modules for binding to apr,
> and a question has arisen regarding checking error codes
> against the appropriate APR_* constants. In apr_errno.h
> there are warnings about using the corresponding
> APR_STATUS_IS_* macros, as there could be more than one
> variant satisfying an error condition (eg,
> APR_STATUS_IS_ENOENT). There are a number of cases though
> for which at present there's only one such condition (eg,
> APR_STATUS_IS_EOF). What we were wondering is if the
> APR_STATUS_IS_* macros are still strongly recommended to use
> in cases where there is only one variant? Or, for such
> cases, has common useage become just to compare against the
> corresponding APR_* constant (eg, APR_EOF)? Thanks very
> much.

Yes, it's recommended that the APR_STATUS_IS_* macros are used.  In a
small set of cases where the error code is "invented" by APR like
APR_EOF, it doesn't really make any difference, but I suppose possibly
that could change in the future so better to be safe than sorry...

Regards,

joe

Mime
View raw message