[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] fixes svn's chdir before invoking $EDITOR for commit log message

From: Justin Erenkrantz <jerenkrantz_at_apache.org>
Date: 2002-08-26 18:46:17 CEST

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

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.