diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2010-11-22 13:09:26 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2010-11-22 13:09:38 +0000 |
commit | 730d4db45ec95d9c9592d7721ff1c5a3db036816 (patch) | |
tree | cef322bb9e2cde87109daf6f2d2d9bd60a0f2172 | |
parent | cb8403c4282ddfbcc204920c72a104eb7f69e373 (diff) | |
download | libguestfs-730d4db45ec95d9c9592d7721ff1c5a3db036816.tar.gz libguestfs-730d4db45ec95d9c9592d7721ff1c5a3db036816.tar.xz libguestfs-730d4db45ec95d9c9592d7721ff1c5a3db036816.zip |
cat: Continue after encountering an error.
-rw-r--r-- | cat/virt-cat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cat/virt-cat.c b/cat/virt-cat.c index 3510a948..2587e563 100644 --- a/cat/virt-cat.c +++ b/cat/virt-cat.c @@ -237,13 +237,15 @@ main (int argc, char *argv[]) /* Free up data structures, no longer needed after this point. */ free_drives (drvs); + unsigned errors = 0; + while (optind < argc) { if (guestfs_download (g, argv[optind], "/dev/stdout") == -1) - exit (EXIT_FAILURE); + errors++; optind++; } guestfs_close (g); - exit (EXIT_SUCCESS); + exit (errors == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } |