#define APLOG_MARK __FILE__,__LINE__
+/**
+ * Set up for logging to stderr.
+ * @param p The pool to allocate out of
+ */
+void ap_open_stderr_log(apr_pool_t *p);
+
/**
* Open the error log and replace stderr with it.
* @param s_main The main server
ap_xml_insert_uri
ap_os_create_privileged_process
+ ap_open_stderr_log
{NULL, -1},
};
+static apr_file_t *stderr_log;
+
+void ap_open_stderr_log(apr_pool_t *p)
+{
+ apr_open_stderr(&stderr_log, p);
+}
+
static int log_child(apr_pool_t *p, const char *progname,
apr_file_t **fpin)
{
if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) &&
((level & APLOG_LEVELMASK) > DEFAULT_LOGLEVEL))
return;
- apr_open_stderr(&logf, pool);
+ logf = stderr_log;
}
else if (s->error_log) {
/*
stat = apr_create_pool(&cntx, NULL);
if (stat != APR_SUCCESS) {
+ /* XXX From the time that we took away the NULL pool->malloc mapping
+ * we have been unable to log here without segfaulting.
+ */
ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
"apr_create_pool() failed to create "
"initial context");
exit(1);
}
+ ap_open_stderr_log(cntx);
+
process = apr_palloc(cntx, sizeof(process_rec));
process->pool = cntx;