diff --git a/src/uevent_sender.c b/src/uevent_sender.c index a9e3b5b..e9b2888 100644 --- a/src/uevent_sender.c +++ b/src/uevent_sender.c @@ -100,8 +100,14 @@ sendmsg_one(struct iovec *iov, size_t iov_len, const char *path) const struct msghdr msg = { .msg_name = &event_addr, .msg_iov = iov, .msg_iovlen = iov_len }; ssize_t count = sendmsg(fd, &msg, 0); if (count < 0) { - perror("uevent_sender sendmsg_one: sendmsg failed"); - abort(); + if (errno == ECONNREFUSED) { + /* client side closed its monitor underneath us, so clean up and ignore */ + unlink(event_addr.sun_path); + close(fd); + return; + } + perror("uevent_sender sendmsg_one: sendmsg failed"); + abort(); } /* printf("passed %zi bytes to event socket %s\n", count, path); */ close(fd);