Fix X-PREPROCESS exec to wait pid

This commit is contained in:
Brian West 2011-03-29 18:05:05 -05:00
parent 135bac5b6d
commit dae2cb4aac
1 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,7 @@
#include <switch.h>
#ifndef WIN32
#include <sys/wait.h>
#include <switch_private.h>
#include <glob.h>
#else /* we're on windoze :( */
@ -1245,6 +1246,7 @@ static int preprocess_exec(const char *cwd, const char *command, int write_fd, i
}
}
close(fds[0]);
waitpid(pid, NULL, 0);
} else { /* child */
close(fds[0]);
dup2(fds[1], STDOUT_FILENO);