From: root Date: Sun, 7 Jul 1996 22:12:06 +0000 (+0000) Subject: take stdin X-Git-Tag: rpm-4.4-release~5004 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9cd8b6196fd5afc99b2ffaed440edfbbd5c9741f;p=platform%2Fupstream%2Frpm.git take stdin mods for HEADER_MAGIC CVS patchset: 731 CVS date: 1996/07/07 22:12:06 --- diff --git a/tools/dump.c b/tools/dump.c index 6274c4a..b9a00ef 100644 --- a/tools/dump.c +++ b/tools/dump.c @@ -11,18 +11,18 @@ void main(int argc, char ** argv) Header h; int fd; - if (argc != 2) { - fprintf(stderr, "dump \n"); - exit(1); + if (argc == 1) { + fd = 0; + } else { + fd = open(argv[1], O_RDONLY, 0644); } - fd = open(argv[1], O_RDONLY); if (fd < 0) { fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno)); exit(1); } - h = readHeader(fd); + h = readHeader(fd, HEADER_MAGIC); if (!h) { fprintf(stderr, "readHeader error: %s\n", strerror(errno)); exit(1);