lkml.org 
[lkml]   [2007]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[patch] add support for reading stdin with gen_init_cpio
Date
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]);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-05-07 07:19    [W:0.042 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site