[core] non-blocking write() to piped loggers

If pipe fills and would block, then discard remaining write.
Do not block lighttpd if the logger blocks, such as if disk fills up.
This commit is contained in:
Glenn Strauss 2018-01-02 20:58:20 -05:00
parent e8226c11cb
commit b9df146b3c
1 changed files with 2 additions and 0 deletions

View File

@ -847,6 +847,8 @@ static int fdevent_open_logger_pipe(const char *logger) {
}
fdevent_setfd_cloexec(fds[0]);
fdevent_setfd_cloexec(fds[1]);
/*(nonblocking write() from lighttpd)*/
if (0 != fdevent_fcntl_set_nb(NULL, fds[1])) { /*(ignore)*/ }
pid = fdevent_open_logger_pipe_spawn(logger, fds[0]);