From: Eric Covener Date: Sat, 17 Mar 2018 18:00:15 +0000 (-0400) Subject: aix compat fixes for ocsp.c X-Git-Tag: OpenSSL_1_1_1-pre4~93 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a9dd51a800f1920aa7545dc2f4f831000a60af48;p=oweals%2Fopenssl.git 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) --- 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;