Make sure we collect exit status from subprocess

Otherwise we leave a zombie during runtime.
tingping/wmclass
Alexander Larsson 2015-01-19 10:24:44 +01:00
parent 2b8be8c7fd
commit 1386db2d58
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,7 @@
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#if 0
@ -838,6 +839,7 @@ main (int argc,
int writable = 0;
int writable_app = 0;
int writable_exports = 0;
int status;
char old_cwd[256];
char tmpdir[] = "/tmp/run-app.XXXXXX";
@ -1097,6 +1099,8 @@ main (int argc,
/* /usr now mounted private inside the namespace, tell child process to unmount the tmpfs in the parent namespace. */
close (pipefd[WRITE_END]);
waitpid (pid, &status, 0);
if (bind_mount ("/etc/passwd", "etc/passwd", BIND_READONLY))
die_with_error ("mount passwd");