summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2014-05-16 16:45:10 +0000
committerBryan Cantrill <bryan@joyent.com>2014-05-16 16:45:10 +0000
commitccd38a70ceb49e112a6e85a46d676873817719b6 (patch)
tree6c304ddb5326168b5ed7ff59ed66f5520c36db7a /usr/src/uts/common
parent008facadb0da6f6b233ae8e2fb90c7a123118162 (diff)
downloadillumos-joyent-ccd38a70ceb49e112a6e85a46d676873817719b6.tar.gz
OS-2985 POLLHUP not generated for disconnected Unix domain sockets
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/fs/sockfs/socktpi.c7
1 files changed, 7 insertions, 0 deletions
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;