commit - 38fb09f69a9a9b20b4c481cc69deda9b8326dabd
commit + 7ede118f9cfa7606ef662f8da69fb81ef6a4c8d0
blob - 2a988d038319e56cbdae6ff83f7b219568c799c5
blob + df30502029283196eafd2f8d11138a848dc4f22a
--- gotd/notify.c
+++ gotd/notify.c
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;
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;