]> granicus.if.org Git - php/commitdiff
Fix bug #77677: WCOREDUMP not available on all systems
authorKevin Adler <kadler@us.ibm.com>
Mon, 18 Feb 2019 16:32:38 +0000 (10:32 -0600)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 1 Mar 2019 13:51:15 +0000 (14:51 +0100)
Add #ifdef WCOREDUMP around all uses.

Also Change core dump message to yes/no/unknown in lsapilib.

NEWS
sapi/fpm/fpm/fpm_children.c
sapi/litespeed/lsapilib.c

diff --git a/NEWS b/NEWS
index 7b2e47330e5c1fad7b3d2d03b03923ea6c779e92..c4b28f8720a03b5e64b4c09713da2a9739af8ddc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,10 @@ PHP                                                                        NEWS
   . Fixed bug #77652 (Anonymous classes can lose their interface information).
     (Nikita)
 
+- FPM:
+  . Fixed bug #77677 (FPM fails to build on AIX due to missing WCOREDUMP).
+    (Kevin Adler)
+
 - Date:
   . Fixed bug #50020 (DateInterval:createDateFromString() silently fails).
     (Derick)
index bda85ef5a86b79d842855d51fc87b42abea93752..eed0c6757a750c24a0adaf246f2f0599aa25933a 100644 (file)
@@ -204,7 +204,11 @@ void fpm_children_bury() /* {{{ */
 
                } else if (WIFSIGNALED(status)) {
                        const char *signame = fpm_signal_names[WTERMSIG(status)];
+#ifdef WCOREDUMP
                        const char *have_core = WCOREDUMP(status) ? " - core dumped" : "";
+#else
+                       const char* have_core = "";
+#endif
 
                        if (signame == NULL) {
                                signame = "";
index c72c0e3aa2dfff0ae3da406e89de77ebb8545411..0e4410fbc74f1b0370cc66b73f94c84b075018fa 100644 (file)
@@ -2819,9 +2819,14 @@ static void lsapi_sigchild( int signal )
         if ( WIFSIGNALED( status ))
         {
             int sig_num = WTERMSIG( status );
-            int dump = WCOREDUMP( status );
+
+#ifdef WCOREDUMP
+            const char * dump = WCOREDUMP( status ) ? "yes" : "no";
+#else
+            const char * dump = "unknown";
+#endif
             lsapi_log("Child process with pid: %d was killed by signal: "
-                     "%d, core dump: %d\n", pid, sig_num, dump );
+                     "%d, core dumped: %s\n", pid, sig_num, dump );
         }
         if ( pid == s_pid_dump_debug_info )
         {