}
-static apr_status_t piped_log_cleanup(void *data)
+static apr_status_t piped_log_cleanup_for_exec(void *data)
{
piped_log *pl = data;
- if (pl->pid != NULL) {
- apr_proc_kill(pl->pid, SIGTERM);
- }
apr_file_close(ap_piped_log_read_fd(pl));
apr_file_close(ap_piped_log_write_fd(pl));
return APR_SUCCESS;
}
-static apr_status_t piped_log_cleanup_for_exec(void *data)
+static apr_status_t piped_log_cleanup(void *data)
{
piped_log *pl = data;
- apr_file_close(ap_piped_log_read_fd(pl));
- apr_file_close(ap_piped_log_write_fd(pl));
- return APR_SUCCESS;
+ if (pl->pid != NULL) {
+ apr_proc_kill(pl->pid, SIGTERM);
+ }
+ return piped_log_cleanup_for_exec(data);
}
+
AP_DECLARE(piped_log *) ap_open_piped_log(apr_pool_t *p, const char *program)
{
piped_log *pl;