Commit f2434ec1 authored by Mike Frysinger's avatar Mike Frysinger Committed by Sam Ravnborg

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: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent e99c343f
...@@ -498,7 +498,9 @@ int main (int argc, char *argv[]) ...@@ -498,7 +498,9 @@ int main (int argc, char *argv[])
exit(1); exit(1);
} }
if (! (cpio_list = fopen(argv[1], "r"))) { if (!strcmp(argv[1], "-"))
cpio_list = stdin;
else if (! (cpio_list = fopen(argv[1], "r"))) {
fprintf(stderr, "ERROR: unable to open '%s': %s\n\n", fprintf(stderr, "ERROR: unable to open '%s': %s\n\n",
argv[1], strerror(errno)); argv[1], strerror(errno));
usage(argv[0]); usage(argv[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment