aboutsummaryrefslogtreecommitdiffstats
path: root/usr/gen_init_cpio.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-05-11 01:44:28 -0400
committerSam Ravnborg <sam@ravnborg.org>2007-07-16 15:15:52 -0400
commitf2434ec1e08e44c2568b29c2879b3346aa29dbd2 (patch)
tree12c91c844f8682f0dc2c8c18d3fefaf1984c39d5 /usr/gen_init_cpio.c
parente99c343f169cdcb43f1508873a3c9e19ffe4c64a (diff)
kbuild: add support for reading stdin with gen_init_cpio
Treat an argument of "-" as meaning "read stdin for cpio files" so gen_init_cpio can be piped into. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'usr/gen_init_cpio.c')
-rw-r--r--usr/gen_init_cpio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index 8365db6cfe06..7abc07f0fcd2 100644
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -498,7 +498,9 @@ int main (int argc, char *argv[])
498 exit(1); 498 exit(1);
499 } 499 }
500 500
501 if (! (cpio_list = fopen(argv[1], "r"))) { 501 if (!strcmp(argv[1], "-"))
502 cpio_list = stdin;
503 else if (! (cpio_list = fopen(argv[1], "r"))) {
502 fprintf(stderr, "ERROR: unable to open '%s': %s\n\n", 504 fprintf(stderr, "ERROR: unable to open '%s': %s\n\n",
503 argv[1], strerror(errno)); 505 argv[1], strerror(errno));
504 usage(argv[0]); 506 usage(argv[0]);