/* 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;
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;
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;
}
}
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));