From: Kevin Adler Date: Mon, 18 Feb 2019 16:32:38 +0000 (-0600) Subject: Fix bug #77677: WCOREDUMP not available on all systems X-Git-Tag: php-7.3.4RC1~49^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=006355c9fa0d1cd8aef86a97c162053e7d2d896e;p=php Fix bug #77677: WCOREDUMP not available on all systems Add #ifdef WCOREDUMP around all uses. Also Change core dump message to yes/no/unknown in lsapilib. --- diff --git a/NEWS b/NEWS index 7b2e47330e..c4b28f8720 100644 --- 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) diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c index bda85ef5a8..eed0c6757a 100644 --- a/sapi/fpm/fpm/fpm_children.c +++ b/sapi/fpm/fpm/fpm_children.c @@ -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 = ""; diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index c72c0e3aa2..0e4410fbc7 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -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 ) {