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:
e55c1fc
)
guestfs_launch: Correct checks for dup failure.
author
Richard Jones
<rjones@trick.home.annexia.org>
Wed, 19 Aug 2009 08:37:44 +0000
(09:37 +0100)
committer
Richard Jones
<rjones@trick.home.annexia.org>
Wed, 19 Aug 2009 08:37:44 +0000
(09:37 +0100)
src/guestfs.c
patch
|
blob
|
history
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
58a0354
..
04bd4e8
100644
(file)
--- a/
src/guestfs.c
+++ b/
src/guestfs.c
@@
-1165,16
+1165,16
@@
guestfs_launch (guestfs_h *g)
close (wfd[1]);
close (rfd[0]);
- int fail = 0;
- fail |= dup (wfd[0]);
- fail |= dup (rfd[1]);
- close (wfd[0]);
- close (rfd[1]);
-
- if (fail) {
+ if (dup (wfd[0]) == -1) {
+ dup_failed:
perror ("dup failed");
_exit (1);
}
+ if (dup (rfd[1]) == -1)
+ goto dup_failed;
+
+ close (wfd[0]);
+ close (rfd[1]);
#if 0
/* Set up a new process group, so we can signal this process