Browse Source

[core] report to stderr if errorlog path ENOENT (fixes #2847)

x-ref:
  "handling permissions at startup"
  https://redmine.lighttpd.net/issues/2847
personal/stbuehler/fix-fdevent
Glenn Strauss 4 years ago
parent
commit
0c95ed370f
  1. 5
      src/server.c

5
src/server.c

@ -728,13 +728,14 @@ static int log_error_open(server *srv) {
}
else if (!buffer_string_is_empty(srv->srvconf.errorlog_file)) {
const char *logfile = srv->srvconf.errorlog_file->ptr;
if (-1 == (srv->errorlog_fd = fdevent_open_logger(logfile))) {
int fd = fdevent_open_logger(logfile);
if (-1 == fd) {
log_error_write(srv, __FILE__, __LINE__, "SSSS",
"opening errorlog '", logfile,
"' failed: ", strerror(errno));
return -1;
}
srv->errorlog_fd = fd;
srv->errorlog_mode = logfile[0] == '|' ? ERRORLOG_PIPE : ERRORLOG_FILE;
}

Loading…
Cancel
Save