STABLE14-java-lock-fix-200702310

make it portable. ugh.


(cherry picked from commit 226c1ee8f9e24e199b2e2cf1ecc11dd072634450)
This commit is contained in:
Derrick Brashear 2007-03-10 16:08:08 +00:00
parent be0b74e0ce
commit 5bb24173fe

View File

@ -26,9 +26,9 @@ RCSID
#include "afs/afs_osidnlc.h"
#include "afs/unified_afs.h"
#ifndef OFFSET_MAX
#define OFFSET_MAX 0x7fffffffffffffff
#endif
/* Static prototypes */
static int HandleGetLock(register struct vcache *avc,
@ -553,7 +553,7 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
#endif
/* Java VMs ask for l_len=(long)-1 regardless of OS/CPU; bottom 32 bits
* sometimes get masked off by OS */
if (af->l_len == OFFSET_MAX-1)
if ((sizeof(af->l_len) == 8) && (af->l_len == 0x7ffffffffffffffe))
af->l_len = 0;
/* next line makes byte range locks always succeed,
* even when they should block */