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:
3ab8336
)
Check return value from waitpid call in command*() functions.
author
Richard W.M. Jones
<rjones@redhat.com>
Sat, 20 Jun 2009 15:05:12 +0000
(16:05 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Sat, 20 Jun 2009 15:05:12 +0000
(16:05 +0100)
daemon/guestfsd.c
patch
|
blob
|
history
diff --git
a/daemon/guestfsd.c
b/daemon/guestfsd.c
index
2e83b9f
..
030aabe
100644
(file)
--- a/
daemon/guestfsd.c
+++ b/
daemon/guestfsd.c
@@
-453,7
+453,8
@@
commandrv (char **stdoutput, char **stderror, char * const* const argv)
{
int so_size = 0, se_size = 0;
int so_fd[2], se_fd[2];
- int pid, r, quit, i;
+ pid_t pid;
+ int r, quit, i;
fd_set rset, rset2;
char buf[256];
char *p;
@@
-589,7
+590,10
@@
commandrv (char **stdoutput, char **stderror, char * const* const argv)
}
/* Get the exit status of the command. */
- waitpid (pid, &r, 0);
+ if (waitpid (pid, &r, 0) != pid) {
+ perror ("waitpid");
+ return -1;
+ }
if (WIFEXITED (r)) {
return WEXITSTATUS (r);