summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorKevin Adler <kadler@us.ibm.com>2019-02-18 10:32:38 -0600
committerNikita Popov <nikita.ppv@gmail.com>2019-03-01 14:51:15 +0100
commit006355c9fa0d1cd8aef86a97c162053e7d2d896e (patch)
tree83d8b12339eeba2f1ca231d1a0b9e6f7e5cc614e /sapi
parent7d001aff03168260c9bfbd53a118f5de2566e264 (diff)
downloadphp-git-006355c9fa0d1cd8aef86a97c162053e7d2d896e.tar.gz
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.
Diffstat (limited to 'sapi')
-rw-r--r--sapi/fpm/fpm/fpm_children.c4
-rw-r--r--sapi/litespeed/lsapilib.c9
2 files changed, 11 insertions, 2 deletions
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 )
{