arrfab / rpms / httpd

Forked from rpms/httpd 5 years ago
Clone

Blame SOURCES/httpd-2.4.6-rotatelogs-zombie.patch

be05ba
diff --git a/support/rotatelogs.c b/support/rotatelogs.c
be05ba
index 55c4406..f4c6490 100644
be05ba
--- a/support/rotatelogs.c
be05ba
+++ b/support/rotatelogs.c
be05ba
@@ -49,6 +49,7 @@
be05ba
 #include "apr_time.h"
be05ba
 #include "apr_getopt.h"
be05ba
 #include "apr_thread_proc.h"
be05ba
+#include "apr_signal.h"
be05ba
 #if APR_FILES_AS_SOCKETS
be05ba
 #include "apr_poll.h"
be05ba
 #endif
be05ba
@@ -595,6 +596,10 @@ int main (int argc, const char * const argv[])
be05ba
             break;
be05ba
         case 'p':
be05ba
             config.postrotate_prog = opt_arg;
be05ba
+#ifdef SIGCHLD
be05ba
+            /* Prevent creation of zombies (on modern Unix systems). */
be05ba
+            apr_signal(SIGCHLD, SIG_IGN);
be05ba
+#endif
be05ba
             break;
be05ba
         case 'f':
be05ba
             config.force_open = 1;