X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fvol%2Fvutil.c;h=860be8161cfb4ab0d08beb3c05878190a88a26bc;hp=d08b554cf51b88a6e954cb077fc5b983cb3453b7;hb=6201e3baa0d42688434bd8c1d46c62a6ab39d19c;hpb=b71a2daaf0bc8f6c392be0d1f669d58c81c519c7 diff --git a/src/vol/vutil.c b/src/vol/vutil.c index d08b554..860be81 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