From a9dd51a800f1920aa7545dc2f4f831000a60af48 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 17 Mar 2018 14:00:15 -0400 Subject: [PATCH] aix compat fixes for ocsp.c WCOREDUMP and vsyslog are not portable Reviewed-by: Paul Dale Reviewed-by: Matt Caswell Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5657) --- apps/ocsp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/ocsp.c b/apps/ocsp.c index 7581531ccf..015f4d3d1f 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -813,7 +813,10 @@ log_message(int level, const char *fmt, ...) va_start(ap, fmt); # ifdef OCSP_DAEMON if (multi) { - vsyslog(level, fmt, ap); + char buf[1024]; + if (vsnprintf(buf, sizeof(buf), fmt, ap) > 0) { + syslog(level, "%s", buf); + } if (level >= LOG_ERR) ERR_print_errors_cb(print_syslog, &level); } @@ -928,7 +931,10 @@ static void spawn_loop(void) else if (WIFSIGNALED(status)) syslog(LOG_WARNING, "child process: %ld, term signal %d%s", (long)fpid, WTERMSIG(status), - WCOREDUMP(status) ? " (core dumped)" : ""); +#ifdef WCOREDUMP + WCOREDUMP(status) ? " (core dumped)" : +#endif + ""); sleep(1); } break; -- 2.34.1