diff options
author | jbj <devnull@localhost> | 1998-11-18 21:41:05 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1998-11-18 21:41:05 +0000 |
commit | 2578b7fc8451f06f83640b448bda098e295447cb (patch) | |
tree | 5e2aca0b793a070ee6db89e5aa2ddee3e68ccc5d /rpmio | |
parent | 9e52926682d6df396086c32c9c86a81212441775 (diff) | |
download | rpm-2578b7fc8451f06f83640b448bda098e295447cb.tar.gz rpm-2578b7fc8451f06f83640b448bda098e295447cb.tar.bz2 rpm-2578b7fc8451f06f83640b448bda098e295447cb.zip |
implement abstract fd type almost everywhere.
CVS patchset: 2542
CVS date: 1998/11/18 21:41:05
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/macro.c | 10 |
1 files changed, 6 insertions, 4 deletions
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)); |