poll: Fix inverse test
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 28 Aug 2017 14:38:25 +0000 (22:38 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 28 Aug 2017 14:38:25 +0000 (22:38 +0800)
sys/kern/sys_generic.c

index f10b06a..950424e 100644 (file)
@@ -1468,7 +1468,7 @@ poll_copyout(void *arg, struct kevent *kevp, int count, int *res)
                                            kevp[i].filter != EVFILT_WRITE &&
                                            kevp[i].data != EOPNOTSUPP &&
                                            kevp[i].data != ENODEV) {
-                                               if (count_res == 0)
+                                               if (count_res)
                                                        ++*res;
                                                pfd->revents |= POLLERR;
                                        }