public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] add support for reading stdin with gen_init_cpio
@ 2007-05-07  5:17 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2007-05-07  5:17 UTC (permalink / raw)
  To: akpm, linux-kernel

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>
---
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index 8365db6..7abc07f 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]);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-07  5:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-07  5:17 [patch] add support for reading stdin with gen_init_cpio Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox