summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-10-30 16:43:29 +0000
committerjbj <devnull@localhost>1999-10-30 16:43:29 +0000
commit2b84d36c2edb0acd8f47bd3316e1535cfdf60fc0 (patch)
tree5d1b1ea400702929b202811bf728a6e6ecf098ab /rpmio
parent533991efdbbeff0c0f3b6f5b008c748ee61bc85e (diff)
downloadrpm-2b84d36c2edb0acd8f47bd3316e1535cfdf60fc0.tar.gz
rpm-2b84d36c2edb0acd8f47bd3316e1535cfdf60fc0.tar.bz2
rpm-2b84d36c2edb0acd8f47bd3316e1535cfdf60fc0.zip
Make fdFileno() static, use Fileno()/Ferror() analogues throughout.
Make ufdClose() static, use Fclose() with ufdio cookie throughout. rpm.c: Clean urlinfoCache and rpmBuildArgs leaks. url.c: urlIsURL() should be here, not in rpmio.c. url.c: Preserve FD_t abstraction by creating ufdGetUrlinfo(). url.c: Create freeUrlinfoCache(). rpmio.c: Create ufdio cookie. CVS patchset: 3407 CVS date: 1999/10/30 16:43:29
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/macro.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 5980ecd3e..afc0aca66 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -25,7 +25,7 @@
#define _(x) x
#define xfree(_p) free((void *)_p)
typedef int FD_t;
-#define fdFileno(_x) (_x)
+#define Ferror(_x) (_x)
#define fdOpen open
#define Fread(_b, _s, _n, _fd) read(_fd, _b, _s)
#define Fclose(_fd) close(_fd)
@@ -1341,7 +1341,9 @@ int isCompressed(const char *file, int *compressed)
*compressed = COMPRESSED_NOT;
- if (fdFileno(fd = fdOpen(file, O_RDONLY, 0)) < 0) {
+ fd = fdOpen(file, O_RDONLY, 0);
+ if (Ferror(fd)) {
+ /* XXX Fstrerror */
rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(errno));
return 1;
}