From 5136065b7002567705ad4ecc65e5bdd53a4f67a7 Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 28 Sep 2021 10:00:18 +0000 Subject: [PATCH] Fix timeout behaviour bug introduced in 1.241. If the timespec is zero-valued sys___thrsigdivert() should just do the check for pending signals and return immediatly. OK kettenis@ --- sys/kern/kern_sig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index f23ffe9c1d6..24d87cdb50f 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.282 2021/07/14 22:09:24 bluhm Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.283 2021/09/28 10:00:18 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1799,8 +1799,8 @@ sys___thrsigdivert(struct proc *p, void *v, register_t *retval) /* per-POSIX, delay this error until after the above */ if (timeinvalid) error = EINVAL; - - if (SCARG(uap, timeout) != NULL && nsecs == INFSLP) + /* per-POSIX, return immediatly if timeout is zero-valued */ + if (nsecs == 0) error = EAGAIN; if (error != 0) -- 2.20.1