commit 7ede118f9cfa7606ef662f8da69fb81ef6a4c8d0 from: Stefan Sperling via: Thomas Adam date: Mon Apr 29 12:22:32 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 - 38fb09f69a9a9b20b4c481cc69deda9b8326dabd commit + 7ede118f9cfa7606ef662f8da69fb81ef6a4c8d0 blob - 2a988d038319e56cbdae6ff83f7b219568c799c5 blob + df30502029283196eafd2f8d11138a848dc4f22a --- gotd/notify.c +++ gotd/notify.c @@ -353,9 +353,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; @@ -452,9 +452,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;