* @param p The pool to create any storage from
* @param s Server for which the logger is initialized
* @return Pointer to handle passed later to writer() function
+ * @note On success, the provider must return non-NULL, even if
+ * the handle is not necessary when the writer() function is
+ * called. On failure, the provider should log a startup error
+ * message and return NULL to abort httpd startup.
*/
void * (*init)(apr_pool_t *p, server_rec *s);
static void *syslog_error_log_init(apr_pool_t *p, server_rec *s)
{
char *fname = s->error_fname;
+ void *success = (void *)p; /* anything non-NULL is success */
+
if (*fname == '\0') {
openlog(ap_server_argv0, LOG_NDELAY|LOG_CONS|LOG_PID, LOG_LOCAL7);
}
if (!strcasecmp(fname, fac->t_name)) {
openlog(ap_server_argv0, LOG_NDELAY|LOG_CONS|LOG_PID,
fac->t_val);
- return NULL;
+ return success;
}
}
}
- return NULL;
+ return success;
}
static apr_status_t syslog_error_log(const ap_errorlog_info *info,
else if (s->errorlog_provider) {
s->errorlog_provider_handle = s->errorlog_provider->init(p, s);
s->error_log = NULL;
+ if (!s->errorlog_provider_handle) {
+ /* provider must log something to the console */
+ return DONE;
+ }
}
else {
fname = ap_server_root_relative(p, s->error_fname);