From ccd38a70ceb49e112a6e85a46d676873817719b6 Mon Sep 17 00:00:00 2001 From: Bryan Cantrill Date: Fri, 16 May 2014 16:45:10 +0000 Subject: OS-2985 POLLHUP not generated for disconnected Unix domain sockets --- usr/src/uts/common/fs/sockfs/socktpi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr/src/uts/common/fs/sockfs/socktpi.c b/usr/src/uts/common/fs/sockfs/socktpi.c index 582db26448..43bc503ed1 100644 --- a/usr/src/uts/common/fs/sockfs/socktpi.c +++ b/usr/src/uts/common/fs/sockfs/socktpi.c @@ -6271,6 +6271,13 @@ sotpi_poll( if (sti->sti_conn_ind_head != NULL) *reventsp |= (POLLIN|POLLRDNORM) & events; + if (so->so_state & SS_CANTRCVMORE) { + *reventsp |= POLLRDHUP & events; + + if (so->so_state & SS_CANTSENDMORE) + *reventsp |= POLLHUP; + } + if (so->so_state & SS_OOBPEND) *reventsp |= POLLRDBAND & events; -- cgit v1.2.3