From 2b7d18848aeaf7b7936cefa07cc31dea8b07f345 Mon Sep 17 00:00:00 2001 From: "Samuel J. Greear" Date: Tue, 3 Aug 2010 06:06:27 +0000 Subject: [PATCH] kernel - Silently swallow EOPNOTSUPP filter errors for poll(2) in all cases * This fixes firefox/gconfd/others Reported-by: tuxillo --- sys/kern/sys_generic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index aeb9bf3857..1983388b4a 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1321,9 +1321,15 @@ poll_copyout(void *arg, struct kevent *kevp, int count, int *res) * Poll silently swallows any unknown * errors except in the case of POLLPRI * (OOB/urgent data). + * + * ALWAYS filter out EOPNOTSUPP errors + * from filters, common applications + * set POLLPRI|POLLRDBAND and most + * filters do not support EVFILT_EXCEPT. */ if (kevp[i].filter != EVFILT_READ && - kevp[i].filter != EVFILT_WRITE) { + kevp[i].filter != EVFILT_WRITE && + kevp[i].data != EOPNOTSUPP) { if (pfd->revents == 0) ++*res; pfd->revents |= POLLERR; -- 2.41.0