mirror of
https://git.openafs.org/openafs.git
synced 2025-01-21 00:10:15 +00:00
vol: fix OS_LOCKFILE/OS_UNLOCKFILE for Windows
On UNIX the OS_LOCKFILE and OS_UNLOCKFILE macros return zero on success. Since Windows LockFile() and UnlockFile() return non-zero (TRUE) on success, negate the return value as part of the macro definition. Change-Id: Icb4c8555de9a16fdfddcaeb9ede28bbd401e76b7 Reviewed-on: http://gerrit.openafs.org/3664 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
parent
ac79869f62
commit
e8e69d5b2c
@ -378,8 +378,8 @@ extern ssize_t ih_pwrite(int fd, const void * buf, size_t count, afs_foff_t offs
|
||||
#define OS_PWRITE(FD, B, S, O) ih_pwrite(FD, B, S, O)
|
||||
#endif /* !HAVE_PIO */
|
||||
#ifdef AFS_NT40_ENV
|
||||
#define OS_LOCKFILE(FD, O) LockFile(FD, (O & 0xFFFFFFFF), (O >> 32), 2, 0)
|
||||
#define OS_UNLOCKFILE(FD, O) UnlockFile(FD, (O & 0xFFFFFFFF), (O >> 32), 2, 0)
|
||||
#define OS_LOCKFILE(FD, O) (!LockFile(FD, (O & 0xFFFFFFFF), (O >> 32), 2, 0))
|
||||
#define OS_UNLOCKFILE(FD, O) (!UnlockFile(FD, (O & 0xFFFFFFFF), (O >> 32), 2, 0))
|
||||
#define OS_ERROR(X) nterr_nt2unix(GetLastError(), X)
|
||||
#define OS_UNLINK(X) nt_unlink(X)
|
||||
#define OS_DIRSEP "\\"
|
||||
|
Loading…
Reference in New Issue
Block a user