From 6201e3baa0d42688434bd8c1d46c62a6ab39d19c Mon Sep 17 00:00:00 2001 From: Rod Widdowson Date: Sat, 22 Jan 2011 16:25:42 +0000 Subject: [PATCH] vutil.c: use OS_XXX rather than afs_XXX 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 Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- src/vol/vutil.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/vol/vutil.c b/src/vol/vutil.c index d08b554cf..860be8161 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -66,13 +66,6 @@ #include #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 -- 2.39.5