Do not compare an FD_t < 0

FD_t is an abstract type.  Invalid file decriptors are == INVALID_FD.
In most places this module does the right thing.  Fix the last
stragglers where it is testing as less than zero.

Change-Id: I9ae3db8775ce69da070a4ebef5a532e1db035977
Reviewed-on: http://gerrit.openafs.org/3768
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Rod Widdowson 2011-01-28 16:49:03 +00:00 committed by Derrick Brashear
parent 52556d5029
commit 299e942ae9

View File

@ -156,8 +156,6 @@ namei_iwrite(IHandle_t * h, afs_foff_t offset, char *buf, afs_fsize_t size)
return nBytes;
}
#ifdef AFS_NT40_ENV
/* Inode number format:
* low 32 bits - if a regular file or directory, the vnode; else the type.
@ -2930,7 +2928,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
(void)afs_snprintf(oldpath, sizeof oldpath, "%s" OS_DIRSEP "%s", dir_name,
infoName);
fd = afs_open(oldpath, O_RDWR, 0);
if (fd < 0) {
if (fd == INVALID_FD) {
Log("1 namei_ConvertROtoRWvolume: could not open RO info file: %s\n",
oldpath);
code = -1;
@ -2939,7 +2937,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
t_ih.ih_ino = namei_MakeSpecIno(ih->ih_vid, VI_VOLINFO);
namei_HandleToName(&n, &t_ih);
fd2 = afs_open(n.n_path, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0);
if (fd2 < 0) {
if (fd2 == INVALID_FD) {
Log("1 namei_ConvertROtoRWvolume: could not create RW info file: %s\n", n.n_path);
OS_CLOSE(fd);
code = -1;
@ -2961,7 +2959,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
(void)afs_snprintf(newpath, sizeof newpath, "%s" OS_DIRSEP "%s", dir_name,
smallName);
fd = afs_open(newpath, O_RDWR, 0);
if (fd < 0) {
if (fd == INVALID_FD) {
Log("1 namei_ConvertROtoRWvolume: could not open SmallIndex file: %s\n", newpath);
code = -1;
goto done;
@ -2980,7 +2978,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
(void)afs_snprintf(newpath, sizeof newpath, "%s" OS_DIRSEP "%s", dir_name,
largeName);
fd = afs_open(newpath, O_RDWR, 0);
if (fd < 0) {
if (fd == INVALID_FD) {
Log("1 namei_ConvertROtoRWvolume: could not open LargeIndex file: %s\n", newpath);
code = -1;
goto done;