git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb8403c
)
cat: Continue after encountering an error.
author
Richard W.M. Jones
<rjones@redhat.com>
Mon, 22 Nov 2010 13:09:26 +0000
(13:09 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Mon, 22 Nov 2010 13:09:38 +0000
(13:09 +0000)
cat/virt-cat.c
patch
|
blob
|
history
diff --git
a/cat/virt-cat.c
b/cat/virt-cat.c
index
3510a94
..
2587e56
100644
(file)
--- 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)
- e
xit (EXIT_FAILURE)
;
+ e
rrors++
;
optind++;
}
guestfs_close (g);
- exit (
EXIT_SUCCESS
);
+ exit (
errors == 0 ? EXIT_SUCCESS : EXIT_FAILURE
);
}