From 299e942ae98dfea3a4804c724e5d440715974e0c Mon Sep 17 00:00:00 2001 From: Rod Widdowson Date: Fri, 28 Jan 2011 16:49:03 +0000 Subject: [PATCH] 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 Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear --- src/vol/namei_ops.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 2d6f1ce..f7e5048 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -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; -- 1.9.4