diff options
author | jbj <devnull@localhost> | 1999-11-02 14:33:14 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-11-02 14:33:14 +0000 |
commit | 7fc3a97733080a03e8bb3872bd37019db483b93c (patch) | |
tree | 3a61e2602283c9adf7441ed5acd1068cbf16fd98 /tools | |
parent | 65a08c9e60c0bff0e09cfdcc98ca97910ab24ac5 (diff) | |
download | rpm-7fc3a97733080a03e8bb3872bd37019db483b93c.tar.gz rpm-7fc3a97733080a03e8bb3872bd37019db483b93c.tar.bz2 rpm-7fc3a97733080a03e8bb3872bd37019db483b93c.zip |
Add ref/deref/new/fileno/open vectors to FDIO_t.
Hide fdOpen/ufdOpen, use {fdio,ufdio}->open throughout.
url.c: Create ref counted abstract urlinfo type with debugging.
url.c: Rename functions to urlNew/urlFree/urlFreeCache for consistency.
rpmio.c: Create ref counted abstract FD_t type with debugging.
rpmio.c: Create private struct _FD_s type.
cpio.c: Create fd[GS]etCpioPos to preserve FD_t abstraction.
CVS patchset: 3414
CVS date: 1999/11/02 14:33:14
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dump.c | 10 | ||||
-rw-r--r-- | tools/rpmarchive.c | 2 | ||||
-rw-r--r-- | tools/rpmgettext.c | 4 | ||||
-rw-r--r-- | tools/rpmheader.c | 2 | ||||
-rw-r--r-- | tools/rpminject.c | 2 | ||||
-rw-r--r-- | tools/rpmlead.c | 2 | ||||
-rw-r--r-- | tools/rpmsignature.c | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/tools/dump.c b/tools/dump.c index 92506ca06..5d660fa27 100644 --- a/tools/dump.c +++ b/tools/dump.c @@ -1,6 +1,6 @@ #include "system.h" -#include "rpmlib.h" +#include <rpmlib.h> int main(int argc, char ** argv) { @@ -11,18 +11,18 @@ int main(int argc, char ** argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = fdOpen(argv[1], O_RDONLY, 0644); + fdi = ufdio->open(argv[1], O_RDONLY, 0644); } - if (Fileno(fdi) < 0) { + if (Ferror(fdi)) { fprintf(stderr, _("cannot open %s: %s\n"), argv[1], strerror(errno)); - exit(1); + exit(EXIT_FAILURE); } h = headerRead(fdi, HEADER_MAGIC_YES); if (!h) { fprintf(stderr, _("headerRead error: %s\n"), strerror(errno)); - exit(1); + exit(EXIT_FAILURE); } Fclose(fdi); diff --git a/tools/rpmarchive.c b/tools/rpmarchive.c index 415969092..5253ca716 100644 --- a/tools/rpmarchive.c +++ b/tools/rpmarchive.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = fdOpen(argv[1], O_RDONLY, 0644); + fdi = ufdio->open(argv[1], O_RDONLY, 0644); } readLead(fdi, &lead); diff --git a/tools/rpmgettext.c b/tools/rpmgettext.c index 9f89565cf..cb0b7289a 100644 --- a/tools/rpmgettext.c +++ b/tools/rpmgettext.c @@ -761,7 +761,7 @@ rewriteBinaryRPM(char *fni, char *fno, message_list_ty *mlp) DPRINTF(99, ("rewriteBinaryRPM(\"%s\",\"%s\",%p)\n", fni, fno, mlp)); csa->cpioArchiveSize = 0; - csa->cpioFdIn = fdNew(&fdio); + csa->cpioFdIn = fdNew(fdio, "init (rewriteBinary)"); csa->cpioList = NULL; csa->cpioCount = 0; csa->lead = &lead; /* XXX FIXME: exorcize lead/arch/os */ @@ -836,7 +836,7 @@ rpmgettext(FD_t fd, const char *file, FILE *ofp) } } - fd = fdOpen(fni, O_RDONLY, 0644); + fd = fdio->open(fni, O_RDONLY, 0644); if (Ferror(fd)) { /* XXX Fstrerror */ fprintf(stderr, _("rpmgettext: open %s: %s\n"), fni, strerror(errno)); diff --git a/tools/rpmheader.c b/tools/rpmheader.c index 61e53bfde..a05321c08 100644 --- a/tools/rpmheader.c +++ b/tools/rpmheader.c @@ -17,7 +17,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = fdOpen(argv[1], O_RDONLY, 0644); + fdi = ufdio->open(argv[1], O_RDONLY, 0644); if (Ferror(fdi)) { perror(argv[1]); exit(EXIT_FAILURE); diff --git a/tools/rpminject.c b/tools/rpminject.c index 6f9aec914..da733c20a 100644 --- a/tools/rpminject.c +++ b/tools/rpminject.c @@ -444,7 +444,7 @@ rewriteRPM(const char *fni, const char *fno, cmd_t *cmds[], int ncmds) int rc; csa->cpioArchiveSize = 0; - csa->cpioFdIn = fdNew(&fdio); + csa->cpioFdIn = fdNew(fdio, "init (rewriteRPM)"); csa->cpioList = NULL; csa->cpioCount = 0; csa->lead = &lead; /* XXX FIXME: exorcize lead/arch/os */ diff --git a/tools/rpmlead.c b/tools/rpmlead.c index 48b9cc691..a60e02f76 100644 --- a/tools/rpmlead.c +++ b/tools/rpmlead.c @@ -14,7 +14,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = fdOpen(argv[1], O_RDONLY, 0644); + fdi = ufdio->open(argv[1], O_RDONLY, 0644); if (Ferror(fdi)) { perror(argv[1]); exit(EXIT_FAILURE); diff --git a/tools/rpmsignature.c b/tools/rpmsignature.c index 9f825decd..0a0219999 100644 --- a/tools/rpmsignature.c +++ b/tools/rpmsignature.c @@ -15,7 +15,7 @@ int main(int argc, char **argv) if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { - fdi = fdOpen(argv[1], O_RDONLY, 0644); + fdi = ufdio->open(argv[1], O_RDONLY, 0644); if (Ferror(fdi)) { perror(argv[1]); exit(1); |