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

View File

@ -56,6 +56,7 @@
#include <switch.h> #include <switch.h>
#ifndef WIN32 #ifndef WIN32
#include <sys/wait.h>
#include <switch_private.h> #include <switch_private.h>
#include <glob.h> #include <glob.h>
#else /* we're on windoze :( */ #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]); close(fds[0]);
waitpid(pid, NULL, 0);
} else { /* child */ } else { /* child */
close(fds[0]); close(fds[0]);
dup2(fds[1], STDOUT_FILENO); dup2(fds[1], STDOUT_FILENO);