From 2578b7fc8451f06f83640b448bda098e295447cb Mon Sep 17 00:00:00 2001 From: jbj Date: Wed, 18 Nov 1998 21:41:05 +0000 Subject: implement abstract fd type almost everywhere. CVS patchset: 2542 CVS date: 1998/11/18 21:41:05 --- rpmio/macro.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'rpmio') diff --git a/rpmio/macro.c b/rpmio/macro.c index 2f1eb805a..e6d514a06 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1197,18 +1197,20 @@ freeMacros(MacroContext *mc) int isCompressed(char *file, int *compressed) { - int fd, nb, rderrno; + FD_t fd; + ssize_t nb; + int rderrno; unsigned char magic[4]; *compressed = COMPRESSED_NOT; - if ((fd = open(file, O_RDONLY)) < 0) { + if (fdFileno(fd = fdOpen(file, O_RDONLY, 0)) < 0) { rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(errno)); return 1; } - nb = read(fd, magic, sizeof(magic)); + nb = fdRead(fd, magic, sizeof(magic)); rderrno = errno; - close(fd); + fdClose(fd); if (nb < 0) { rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(rderrno)); -- cgit v1.2.3