Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle spurious "connection refused" when sending a uevent #254

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/uevent_sender.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down