On Mon, Aug 26, 2002 at 06:37:43PM +0200, Alexis Huxley wrote:
> > Don't test against APR errors explicitly. Use APR_STATUS_IS_EACCES.
>
> Out of curiousity, why?
That is the convention to allow platforms to return another error
code that wouldn't be caught by a test of APR_EACCESS to mean
EACCESS.
Namely:
OS/2:
#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
|| (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
|| (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
Win32:
#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \
|| (s) == APR_OS_START_SYSERR + ERROR_ACCESS_DENIED \
|| (s) == APR_OS_START_SYSERR + ERROR_CANNOT_MAKE \
|| (s) == APR_OS_START_SYSERR + ERROR_CURRENT_DIRECTORY \
|| (s) == APR_OS_START_SYSERR + ERROR_DRIVE_LOCKED \
|| (s) == APR_OS_START_SYSERR + ERROR_FAIL_I24 \
|| (s) == APR_OS_START_SYSERR + ERROR_LOCK_VIOLATION \
|| (s) == APR_OS_START_SYSERR + ERROR_LOCK_FAILED \
|| (s) == APR_OS_START_SYSERR + ERROR_NOT_LOCKED \
|| (s) == APR_OS_START_SYSERR + ERROR_NETWORK_ACCESS_DENIED \
|| (s) == APR_OS_START_SYSERR + ERROR_SHARING_VIOLATION)
Netware:
#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
Unix:
#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES)
Therefore, if you don't use this check, you might miss conditions
where you are supposed to detect access denied. -- justin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 26 18:46:52 2002