bnicholes 2002/07/17 10:03:55 Modified: file_io/netware flock.c Log: Getting ready for an API change in the NetWare libraries Revision Changes Path 1.3 +10 -0 apr/file_io/netware/flock.c Index: flock.c =================================================================== RCS file: /home/cvs/apr/file_io/netware/flock.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- flock.c 13 Mar 2002 20:39:10 -0000 1.2 +++ flock.c 17 Jul 2002 17:03:55 -0000 1.3 @@ -55,6 +55,7 @@ #include #include "fileio.h" +/*#define NEW_API */ apr_status_t apr_file_lock(apr_file_t *thefile, int type) { @@ -62,7 +63,12 @@ fc = (type & APR_FLOCK_NONBLOCK) ? NX_RANGE_LOCK_TRYLOCK : NX_RANGE_LOCK_CHECK; +/* Remove this #ifdef once the next NDK ships */ +#ifdef NEW_API + if(NXFileRangeLock(thefile->filedes,fc, 0, 0, NX_LOCK_RANGE_FORWARD) == -1) +#else if(NXFileRangeLock(thefile->filedes,fc, 0, 0) == -1) +#endif return errno; return APR_SUCCESS; @@ -70,7 +76,11 @@ apr_status_t apr_file_unlock(apr_file_t *thefile) { +#ifdef NEW_API + if(NXFileRangeUnlock(thefile->filedes,NX_RANGE_LOCK_CANCEL,0 , 0, NX_LOCK_RANGE_FORWARD) == -1) +#else if(NXFileRangeUnlock(thefile->filedes,NX_RANGE_LOCK_CANCEL,0 , 0) == -1) +#endif return errno; return APR_SUCCESS;