Skip to content

Commit

Permalink
kbuild: add support for reading stdin with gen_init_cpio
Browse files Browse the repository at this point in the history
Treat an argument of "-" as meaning "read stdin for cpio files" so
gen_init_cpio can be piped into.

Signed-off-by: Mike Frysinger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
  • Loading branch information
vapier authored and sravnborg committed Jul 16, 2007
1 parent e99c343 commit f2434ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion usr/gen_init_cpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit f2434ec

Please sign in to comment.