commit 1bd35332a599d65566a5fab8c0ff0eb6201812ff from: Stefan Sperling date: Fri Apr 26 12:24:20 2024 UTC prevent gotd notification process from exiting due to EPIPE Ephermeral processes on the other end of a pipe might decide to exit which results in EPIPE when writing. This is not a fatal error but is somewhat expected during normal operation (at least until we improve the inter-process communication about notifications). commit - b883aee3556b3841004d3b1ec76cb0d26de420b0 commit + 1bd35332a599d65566a5fab8c0ff0eb6201812ff blob - 77be7d3f23878f357a4e133557280d9e062ceaa9 blob + 19d26f357f398508ab9a9cc21ebd763ddea506cd --- gotd/notify.c +++ gotd/notify.c @@ -355,9 +355,9 @@ notify_dispatch_session(int fd, short event, void *arg if (event & EV_WRITE) { n = msgbuf_write(&ibuf->w); - if (n == -1 && errno != EAGAIN) + if (n == -1 && errno != EAGAIN && errno != EPIPE) fatal("msgbuf_write"); - if (n == 0) { + if (n == 0 || (n == -1 && errno == EPIPE)) { /* Connection closed. */ shut = 1; goto done; @@ -454,9 +454,9 @@ notify_dispatch(int fd, short event, void *arg) if (event & EV_WRITE) { n = msgbuf_write(&ibuf->w); - if (n == -1 && errno != EAGAIN) + if (n == -1 && errno != EAGAIN && errno != EPIPE) fatal("msgbuf_write"); - if (n == 0) { + if (n == 0 || (n == -1 && errno == EPIPE)) { /* Connection closed. */ shut = 1; goto done;