diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2021-11-16 13:48:24 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2021-11-16 13:48:24 +0000 |
commit | 5ae2c6a6fb0014f5c4d0d0131fea6b4c1927e0ff (patch) | |
tree | d3f12f75f38d8d646d812c2250325be0a0cacb5a /sys/kern/sys_generic.c | |
parent | 253520262f34d574b404cf329373fd36ed42de1c (diff) |
Use nowake when poll/select has empty fd set
When the fd set is empty, the code waits for a signal or timeout.
Wakeups from the kqueue are neither expected nor wanted.
OK cheloha@, millert@, anton@, mpi@
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r-- | sys/kern/sys_generic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 0af21d981fa..3a449784f98 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.140 2021/11/12 04:34:22 visa Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.141 2021/11/16 13:48:23 visa Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -671,7 +671,7 @@ dopselect(struct proc *p, int nd, fd_set *in, fd_set *ou, fd_set *ex, goto done; nsecs = MAX(1, MIN(TIMESPEC_TO_NSEC(timeout), MAXTSLP)); } - error = tsleep_nsec(&p->p_kq, PSOCK | PCATCH, "kqsel", nsecs); + error = tsleep_nsec(&nowake, PSOCK | PCATCH, "kqsel", nsecs); /* select is not restarted after signals... */ if (error == ERESTART) error = EINTR; @@ -1166,7 +1166,7 @@ doppoll(struct proc *p, struct pollfd *fds, u_int nfds, nsecs = MAX(1, MIN(TIMESPEC_TO_NSEC(timeout), MAXTSLP)); } - error = tsleep_nsec(&p->p_kq, PSOCK | PCATCH, "kqpoll", nsecs); + error = tsleep_nsec(&nowake, PSOCK | PCATCH, "kqpoll", nsecs); if (error == ERESTART) error = EINTR; if (error == EWOULDBLOCK) |