[Date Prev][Date Next] [Chronological] [Thread] [Top]

Patch: back-shell generates zombies (ITS#2109)



Full_Name: Michael Haardt
Version: 2.1.5
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (194.97.7.6)


I thought that I reported this before, but anyway, here goes again.

back-shell does not wait() for fork()ed processes, so it generates zombies.
The following trivial patch fixes that for me.

Michael

--- servers/slapd/back-shell/fork.c.orig        2002-09-23 12:31:25.000000000
+0200
+++ servers/slapd/back-shell/fork.c     2002-09-23 13:21:01.000000000 +0200
@@ -8,6 +8,7 @@
 #include "portable.h"
 
 #include <stdio.h>
+#include <sys/wait.h>
 
 #include <ac/errno.h>
 #include <ac/string.h>
@@ -226,6 +227,7 @@
                        exit( EXIT_FAILURE );
                }
                p ^= 1;
+               wait((int*)0);
        }
 }
 #endif /* SHELL_SURROGATE_PARENT */