vutil.c: use OS_XXX rather than afs_XXX
authorRod Widdowson <rdw@steadingsoftware.com>
Sat, 22 Jan 2011 16:25:42 +0000 (16:25 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 22 Feb 2011 08:55:42 +0000 (00:55 -0800)
This checkin replaced the use of afs_open/close with OS_OPEN/OS_CLOSE

Change-Id: Ie0f4edc90cf584112a54a5f8a1676014cc15eeac
Reviewed-on: http://gerrit.openafs.org/3741
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/vol/vutil.c

index d08b554..860be81 100644 (file)
 #include <strings.h>
 #endif
 
-#ifdef O_LARGEFILE
-#define afs_open       open64
-#else /* !O_LARGEFILE */
-#define afs_open       open
-#endif /* !O_LARGEFILE */
-
-
 /* Note:  the volume creation functions herein leave the destroyMe flag in the
    volume header ON:  this means that the volumes will not be attached by the
    file server and WILL BE DESTROYED the next time a system salvage is performed */
@@ -717,17 +710,17 @@ _VHandleVolumeHeader(struct DiskPartition64 *dp, VWalkVolFunc volfunc,
                      int locked, void *rock)
 {
     int error = 0;
-    int fd;
+    FD_t fd;
 
-    if ((fd = afs_open(name, O_RDONLY)) == -1
-        || read(fd, hdr, sizeof(*hdr))
+    if ((fd = OS_OPEN(name, O_RDONLY, 0)) == INVALID_FD
+        || OS_READ(fd, hdr, sizeof(*hdr))
         != sizeof(*hdr)
         || hdr->stamp.magic != VOLUMEHEADERMAGIC) {
         error = 1;
     }
 
-    if (fd >= 0) {
-       close(fd);
+    if (fd != INVALID_FD) {
+       OS_CLOSE(fd);
     }
 
 #ifdef AFSFS_DEMAND_ATTACH_FS