file descriptors on Windows are not ints and therefore
cannot be safely compared against -1. Always use INVALID_FD
which is -1 on UNIX and INVALID_HANDLE_VALUE on Windows.
Change-Id: I8788f95817ee45367f04f4b90b4e6625c5a39dca
Reviewed-on: http://gerrit.openafs.org/3178
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
if (!dp)
return; /* no partition, will fail later */
- if (dp->lock_fd != -1)
+ if (dp->lock_fd != INVALID_FD)
return;
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
else
dp->lock_fd = afs_open(partitionName, code);
- if (dp->lock_fd != -1)
+ if (dp->lock_fd != INVALID_FD)
break;
if (errno == ENOENT)
code |= O_CREAT;
if (!dp)
return; /* no partition, will fail later */
close(dp->lock_fd);
- dp->lock_fd = -1;
+ dp->lock_fd = INVALID_FD;
}
#endif /* AFS_NT40_ENV */