kbuild: add support for reading stdin with gen_init_cpio
authorMike Frysinger <vapier@gentoo.org>
Fri, 11 May 2007 05:44:28 +0000 (22:44 -0700)
committerSam Ravnborg <sam@ravnborg.org>
Mon, 16 Jul 2007 19:15:52 +0000 (21:15 +0200)
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>
usr/gen_init_cpio.c

index 8365db6cfe06449246ef5156a4a886d7e14fbdbc..7abc07f0fcd2603606321dc7e3131453cf313da2 100644 (file)
@@ -498,7 +498,9 @@ int main (int argc, char *argv[])
                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",
                        argv[1], strerror(errno));
                usage(argv[0]);