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:
1d8afa2
)
build: suppress an ignored-dup-return-value warning
author
Jim Meyering
<meyering@redhat.com>
Tue, 18 Aug 2009 13:03:55 +0000
(15:03 +0200)
committer
Jim Meyering
<meyering@redhat.com>
Tue, 18 Aug 2009 15:20:06 +0000
(17:20 +0200)
* src/guestfs.c (guestfs_launch): Handle dup failure.
src/guestfs.c
patch
|
blob
|
history
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
ecdf9e5
..
1cd4f9e
100644
(file)
--- a/
src/guestfs.c
+++ b/
src/guestfs.c
@@
-1162,11
+1162,18
@@
guestfs_launch (guestfs_h *g)
close (1);
close (wfd[1]);
close (rfd[0]);
- dup (wfd[0]);
- dup (rfd[1]);
+
+ int fail = 0;
+ fail |= dup (wfd[0]);
+ fail |= dup (rfd[1]);
close (wfd[0]);
close (rfd[1]);
+ if (fail) {
+ perror ("dup failed");
+ _exit (1);
+ }
+
#if 0
/* Set up a new process group, so we can signal this process
* and all subprocesses (eg. if qemu is really a shell script).