Merge branch 'jc/squash'
[gitweb.git] / connect.c
index 52d709e58d53f053ec00bfb9f31501684cbaf0e5..66e78a29054a121c92beca3d997105f0137c170d 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -8,6 +8,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
+#include <signal.h>
 
 static char *server_capabilities = NULL;
 
@@ -581,6 +582,11 @@ int git_connect(int fd[2], char *url, const char *prog)
        enum protocol protocol = PROTO_LOCAL;
        int free_path = 0;
 
+       /* Without this we cannot rely on waitpid() to tell
+        * what happened to our children.
+        */
+       signal(SIGCHLD, SIG_DFL);
+
        host = strstr(url, "://");
        if(host) {
                *host = '\0';