]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix X-PREPROCESS exec to wait pid
authorBrian West <brian@freeswitch.org>
Tue, 29 Mar 2011 23:05:05 +0000 (18:05 -0500)
committerBrian West <brian@freeswitch.org>
Tue, 29 Mar 2011 23:05:05 +0000 (18:05 -0500)
src/switch_xml.c

index d6cac65c6502fab42edcfc83dc0925f3d41dbde2..124dab9ab03e1c17a621b543d844b8f65afea0c2 100644 (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);