From: Joe Orton Date: Mon, 16 May 2005 19:59:05 +0000 (+0000) Subject: * server/log.c (piped_log_spawn): Return the APR error code, X-Git-Tag: 2.1.5~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=534ee6332c61918575dc6623b77581834cdac1d8;p=apache * server/log.c (piped_log_spawn): Return the APR error code, as expected by piped_log_maintenance (and fixing "Unknown error" messages in error path there). (ap_open_piped_log): Expect an APR error code. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@170441 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/log.c b/server/log.c index 6bcc202e76..16aeebda8a 100644 --- a/server/log.c +++ b/server/log.c @@ -785,9 +785,9 @@ AP_DECLARE(void) ap_log_assert(const char *szExp, const char *szFile, /* forward declaration */ static void piped_log_maintenance(int reason, void *data, apr_wait_t status); -static int piped_log_spawn(piped_log *pl) +/* Spawn the piped logger process pl->program. */ +static apr_status_t piped_log_spawn(piped_log *pl) { - int rc = 0; apr_procattr_t *procattr; apr_proc_t *procnew = NULL; apr_status_t status; @@ -807,7 +807,6 @@ static int piped_log_spawn(piped_log *pl) ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "piped_log_spawn: unable to setup child process '%s': %s", pl->program, apr_strerror(status, buf, sizeof(buf))); - rc = -1; } else { char **args; @@ -832,11 +831,10 @@ static int piped_log_spawn(piped_log *pl) ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "unable to start piped log program '%s': %s", pl->program, apr_strerror(status, buf, sizeof(buf))); - rc = -1; } } - return rc; + return status; } @@ -928,7 +926,7 @@ AP_DECLARE(piped_log *) ap_open_piped_log(apr_pool_t *p, const char *program) } apr_pool_cleanup_register(p, pl, piped_log_cleanup, piped_log_cleanup_for_exec); - if (piped_log_spawn(pl) == -1) { + if (piped_log_spawn(pl) != APR_SUCCESS) { int save_errno = errno; apr_pool_cleanup_kill(p, pl, piped_log_cleanup); apr_file_close(ap_piped_log_read_fd(pl));