Skip to content

Commit

Permalink
Fix bug #77677: WCOREDUMP not available on all systems
Browse files Browse the repository at this point in the history
Add #ifdef WCOREDUMP around all uses.

Also Change core dump message to yes/no/unknown in lsapilib.
  • Loading branch information
kadler authored and nikic committed Mar 1, 2019
1 parent 7d001af commit 006355c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions sapi/fpm/fpm/fpm_children.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down
9 changes: 7 additions & 2 deletions sapi/litespeed/lsapilib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 006355c

Please sign in to comment.