[PATCH] POLLRDHUP/EPOLLRDHUP handling for half-closed devices notifications
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / eventpoll.c
index 1c2b16fda13aa8caf87869f29d2db8eb29ac8438..a0f682cdd03e06e8802efdf320c6da9d436d31ad 100644 (file)
@@ -599,7 +599,7 @@ sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event __user *event)
        switch (op) {
        case EPOLL_CTL_ADD:
                if (!epi) {
-                       epds.events |= POLLERR | POLLHUP;
+                       epds.events |= POLLERR | POLLHUP | POLLRDHUP;
 
                        error = ep_insert(ep, &epds, tfile, fd);
                } else
@@ -613,7 +613,7 @@ sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event __user *event)
                break;
        case EPOLL_CTL_MOD:
                if (epi) {
-                       epds.events |= POLLERR | POLLHUP;
+                       epds.events |= POLLERR | POLLHUP | POLLRDHUP;
                        error = ep_modify(ep, epi, &epds);
                } else
                        error = -ENOENT;