diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2018-01-02 20:58:20 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2018-01-02 21:01:41 -0500 |
commit | b9df146b3c1648328d66243f773cf0e0c956ae18 (patch) | |
tree | 4cac9c1f94ea0ae6e0e048d8da2750cbd161a0cb | |
parent | e8226c11cb108c7659b2dd9d40147227a1d9758d (diff) | |
download | lighttpd-git-b9df146b3c1648328d66243f773cf0e0c956ae18.tar.gz |
[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.
-rw-r--r-- | src/fdevent.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fdevent.c b/src/fdevent.c index e8b94dfa..9b9a1a9f 100644 --- a/src/fdevent.c +++ b/src/fdevent.c @@ -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]); |