socket: improve warning message when we get POLLHUP

This commit is contained in:
Lennart Poettering
2011-04-26 21:39:14 +02:00
parent aa4355f295
commit 641e01dcdc
+6 -1
View File
@@ -1679,7 +1679,12 @@ static void socket_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
log_debug("Incoming traffic on %s", u->meta.id);
if (events != EPOLLIN) {
log_error("%s: Got invalid poll event (0x%x) on socket.", u->meta.id, events);
if (events & EPOLLHUP)
log_error("%s: Got POLLHUP on a listening socket. The service probably invoked shutdown() on it, and should better not do that.", u->meta.id);
else
log_error("%s: Got unexpected poll event (0x%x) on socket.", u->meta.id, events);
goto fail;
}