Some comments and Q's to win32 folks;
> wrowe 01/12/28 18:09:04
>
> Modified: include apr_errno.h
> Log:
> More goodness {I hope} for Win32, and two extra common errors for all.
>
> Revision Changes Path
> 1.82 +55 -7 apr/include/apr_errno.h
>
> Index: apr_errno.h
> +#ifdef EPIPE
> +#define APR_ENOTEMPTY ENOTEMPTY
[Yes, I fixed the EPIPE typo above already.]
> #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)
Dunno which of the lock errors are better classified as an EAGAIN. Suggestions?
> #define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \
> - || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE)
> + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
> + || (s) == APR_OS_START_SYSERR +
> ERROR_INVALID_TARGET_HANDLE)
> #define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \
> + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_ACCESS \
> + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_DATA \
> + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION \
> + || (s) == APR_OS_START_SYSERR + ERROR_INVALID_HANDLE \
> || (s) == APR_OS_START_SYSERR + ERROR_INVALID_PARAMETER \
> - || (s) == APR_OS_START_SYSERR + ERROR_INVALID_FUNCTION)
> + || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
Notice I've defined INVALID_HANDLE in both contexts. Since a handle doesn't
always
represent a file (but we would look at EBADF if we cared when accessing a file)
this should account for both cases.
> #define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \
> || (s) == APR_OS_START_SYSERR + ERROR_SEEK_ON_DEVICE \
> || (s) == APR_OS_START_SYSERR + ERROR_NEGATIVE_SEEK)
Same here, ERROR_NEGATIVE_SEEK means more than one thing, so it's both EINVAL,
and ESPIPE (which we would test first if we were unsure if the apr_file_t we
passed supported seek.)
> #define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \
> || (s) == APR_OS_START_SYSERR + ERROR_NO_DATA \
> + || (s) == APR_OS_START_SYSERR + ERROR_NO_PROC_SLOTS \
> + || (s) == APR_OS_START_SYSERR + ERROR_NESTING_NOT_ALLOWED \
> + || (s) == APR_OS_START_SYSERR + ERROR_MAX_THRDS_REACHED \
> || (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
These have me especially concerned. This is what MS does in it's librarys, but
I
really doubt that EAGAIN is the best solution when these three errors are
encountered.
Comments? Additions? If we get this quite right, Netware can steal our WSA*
interpretations, and OS2 can steal most of it [with minor deviations, using SOCE
errors instead of WSA.]
Bill