- open log immediately after daemonizing, fixes SIGPIPEs on startup (#165)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2049 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.19
Elan Ruusamäe 16 years ago
parent 299ae40e78
commit a18086bc35

@ -16,6 +16,7 @@ NEWS
Content-Length for send-file. Patches by Stefan Buhler
* prevent crash in certain php-fcgi configurations (#841)
* add IdleServers and Scoreboard directives in ?auto mode for mod_status (#1507)
* open log immediately after daemonizing, fixes SIGPIPEs on startup (#165)
- 1.4.18 - 2007-09-09

@ -896,6 +896,17 @@ int main (int argc, char **argv) {
pid_fd = -1;
}
// Close stderr ASAP in the child process to make sure that nothing
// is being written to that fd which may not be valid anymore.
if (-1 == log_error_open(srv)) {
log_error_write(srv, __FILE__, __LINE__, "s", "Opening errorlog failed. Going down.");
plugins_free(srv);
network_close(srv);
server_free(srv);
return -1;
}
if (HANDLER_GO_ON != plugins_call_set_defaults(srv)) {
log_error_write(srv, __FILE__, __LINE__, "s", "Configuration of plugins failed. Going down.");
@ -946,15 +957,7 @@ int main (int argc, char **argv) {
return -1;
}
if (-1 == log_error_open(srv)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"opening errorlog failed, dying");
plugins_free(srv);
network_close(srv);
server_free(srv);
return -1;
}
#ifdef HAVE_SIGACTION

Loading…
Cancel
Save