From: Mike Frysinger Date: Fri, 11 May 2007 05:44:28 +0000 (-0700) Subject: kbuild: add support for reading stdin with gen_init_cpio X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f2434ec1e08e44c2568b29c2879b3346aa29dbd2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- 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[]) 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]);