return pl->write_fd;
}
-/* clear_handle_list() is called when plog is cleared; at that
- * point we need to forget about our old list of pipe read
- * handles. We let the plog cleanups close the actual pipes.
- */
-static apr_status_t clear_handle_list(void *v)
-{
- read_handles = NULL;
- return APR_SUCCESS;
-}
-
/* remember to close this handle in the child process
*
* On Win32 this makes zero sense, because we don't
* between log phases, so we don't mind losing stderr's
* read_handle a little bit early.
*/
- apr_pool_cleanup_register(p, NULL, clear_handle_list,
+ apr_pool_cleanup_register(p, &read_handles, ap_pool_cleanup_set_null,
apr_pool_cleanup_null);
/* HERE we need a stdout log that outlives plog.
else if (skipping) {
continue;
}
- else if (item->min_loglevel > info->level) {
+ else if ((int)item->min_loglevel > info->level) {
len = field_start;
skipping = 1;
}
}
}
- sconf = ap_get_module_config(s->module_config, &core_module);
- if (c && !c->log_id) {
- add_log_id(c, NULL);
- if (sconf->error_log_conn && sconf->error_log_conn->nelts > 0)
- log_conn_info = 1;
- }
- if (r) {
- if (r->main)
- rmain = r->main;
- else
- rmain = r;
-
- if (!rmain->log_id) {
- /* XXX: do we need separate log ids for subrequests? */
- if (sconf->error_log_req && sconf->error_log_req->nelts > 0)
- log_req_info = 1;
- /*
- * XXX: potential optimization: only create log id if %L is
- * XXX: actually used
- */
- add_log_id(c, rmain);
+ /* the faked server_rec from mod_cgid does not have s->module_config */
+ if (s->module_config) {
+ sconf = ap_get_module_config(s->module_config, &core_module);
+ if (c && !c->log_id) {
+ add_log_id(c, NULL);
+ if (sconf->error_log_conn && sconf->error_log_conn->nelts > 0)
+ log_conn_info = 1;
+ }
+ if (r) {
+ if (r->main)
+ rmain = r->main;
+ else
+ rmain = r;
+
+ if (!rmain->log_id) {
+ /* XXX: do we need separate log ids for subrequests? */
+ if (sconf->error_log_req && sconf->error_log_req->nelts > 0)
+ log_req_info = 1;
+ /*
+ * XXX: potential optimization: only create log id if %L is
+ * XXX: actually used
+ */
+ add_log_id(c, rmain);
+ }
}
}
}
"Command line: '%s'", result);
}
+AP_DECLARE(void) ap_remove_pid(apr_pool_t *p, const char *rel_fname)
+{
+ apr_status_t rv;
+ const char *fname = ap_server_root_relative(p, rel_fname);
+
+ if (fname != NULL) {
+ rv = apr_file_remove(fname, p);
+ if (rv != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
+ "failed to remove PID file %s", fname);
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
+ "removed PID file %s (pid=%" APR_PID_T_FMT ")",
+ fname, getpid());
+ }
+ }
+}
+
AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
{
apr_file_t *pid_file = NULL;