[PATCH] uniform POLLRDHUP handling between epoll and poll/select

As reported by Michael Kerrisk, POLLRDHUP handling was not consistent
between epoll and poll/select, since in epoll it was unmaskeable.  This
patch brings uniformity in POLLRDHUP handling.

Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
Cc: Michael Kerrisk <mtk-manpages@gmx.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Davide Libenzi
2006-04-10 22:54:12 -07:00
committed by Linus Torvalds
parent 0f6c840d77
commit 2395140ee2

View File

@@ -599,7 +599,7 @@ sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event __user *event)
switch (op) { switch (op) {
case EPOLL_CTL_ADD: case EPOLL_CTL_ADD:
if (!epi) { if (!epi) {
epds.events |= POLLERR | POLLHUP | POLLRDHUP; epds.events |= POLLERR | POLLHUP;
error = ep_insert(ep, &epds, tfile, fd); error = ep_insert(ep, &epds, tfile, fd);
} else } else
@@ -613,7 +613,7 @@ sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event __user *event)
break; break;
case EPOLL_CTL_MOD: case EPOLL_CTL_MOD:
if (epi) { if (epi) {
epds.events |= POLLERR | POLLHUP | POLLRDHUP; epds.events |= POLLERR | POLLHUP;
error = ep_modify(ep, epi, &epds); error = ep_modify(ep, epi, &epds);
} else } else
error = -ENOENT; error = -ENOENT;