wrowe 2002/12/10 00:56:42
Modified: include apr_errno.h
file_io/win32 flock.c
Log:
IIUC, users expect APR_EAGAIN() to respond TRUE if a lock has contention
calling apr_file_lock() with APR_FLOCK_NONBLOCK. In that case, we need
to include this in our APR_EAGAIN() case list.
I suspect OS2 may want the same.
Revision Changes Path
1.102 +1 -0 apr/include/apr_errno.h
Index: apr_errno.h
===================================================================
RCS file: /home/cvs/apr/include/apr_errno.h,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- apr_errno.h 10 Nov 2002 08:35:16 -0000 1.101
+++ apr_errno.h 10 Dec 2002 08:56:41 -0000 1.102
@@ -1014,6 +1014,7 @@
|| (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 + ERROR_LOCK_VIOLATION \
|| (s) == APR_OS_START_SYSERR + WSAEWOULDBLOCK)
#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \
|| (s) == APR_OS_START_SYSERR + WSAEINTR)
1.11 +0 -5 apr/file_io/win32/flock.c
Index: flock.c
===================================================================
RCS file: /home/cvs/apr/file_io/win32/flock.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- flock.c 13 Mar 2002 20:39:12 -0000 1.10
+++ flock.c 10 Dec 2002 08:56:42 -0000 1.11
@@ -66,11 +66,6 @@
flags = ((type & APR_FLOCK_NONBLOCK) ? LOCKFILE_FAIL_IMMEDIATELY : 0)
+ (((type & APR_FLOCK_TYPEMASK) == APR_FLOCK_SHARED)
? 0 : LOCKFILE_EXCLUSIVE_LOCK);
- /* XXX on NT 4.0 we get ERROR_LOCK_VIOLATION when we specify
- * LOCKFILE_FAIL_IMMEDIATELY and another process is holding
- * the lock; something needs to be done so an APR app can
- * recognize this as a try-again situation
- */
if (apr_os_level >= APR_WIN_NT) {
/* Syntax is correct, len is passed for LengthLow and LengthHigh*/
OVERLAPPED offset;