summaryrefslogtreecommitdiff
path: root/tools/dump.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-06-17 22:18:03 +0000
committerjbj <devnull@localhost>2001-06-17 22:18:03 +0000
commit29ea1567e7eafc457aed5529b240161cf8d4657f (patch)
treea791a4344419b7b942fd4d755d25a3a6b4c4e5a3 /tools/dump.c
parentc32276cdf5c28d7d701d7211e55f28ebc6f097d7 (diff)
downloadrpm-29ea1567e7eafc457aed5529b240161cf8d4657f.tar.gz
rpm-29ea1567e7eafc457aed5529b240161cf8d4657f.tar.bz2
rpm-29ea1567e7eafc457aed5529b240161cf8d4657f.zip
Sync with rpm-4_0 branch.
CVS patchset: 4876 CVS date: 2001/06/17 22:18:03
Diffstat (limited to 'tools/dump.c')
-rw-r--r--tools/dump.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/dump.c b/tools/dump.c
index 6d05af679..584372fab 100644
--- a/tools/dump.c
+++ b/tools/dump.c
@@ -1,6 +1,7 @@
#include "system.h"
#include <rpmlib.h>
+#include "header_internal.h"
#include "debug.h"
int main(int argc, char ** argv)
@@ -15,20 +16,21 @@ int main(int argc, char ** argv)
fdi = Fopen(argv[1], "r.ufdio");
}
- if (fdi == NULL || Ferror(fdi)) {
- fprintf(stderr, _("cannot open %s: %s\n"), argv[1], strerror(errno));
+ if (Ferror(fdi)) {
+ fprintf(stderr, _("cannot open %s: %s\n"),
+ (argc == 1 ? "<stdin>" : argv[1]), Fstrerror(fdi));
exit(EXIT_FAILURE);
}
h = headerRead(fdi, HEADER_MAGIC_YES);
if (!h) {
- fprintf(stderr, _("headerRead error: %s\n"), strerror(errno));
+ fprintf(stderr, _("headerRead error: %s\n"), Fstrerror(fdi));
exit(EXIT_FAILURE);
}
Fclose(fdi);
headerDump(h, stdout, HEADER_DUMP_INLINE, rpmTagTable);
- headerFree(h);
+ h = headerFree(h);
return 0;
}