From 54569cf17b352c31ddf0d3e1dd7acee462d4e90e Mon Sep 17 00:00:00 2001 From: guenther Date: Mon, 19 Dec 2022 03:40:20 +0000 Subject: [PATCH] waitid(2) returns 0 on success; do post-call cancelation only if it either failed, or succeeded but didn't put a status into infop. ok millert@ --- lib/libc/sys/w_waitid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/sys/w_waitid.c b/lib/libc/sys/w_waitid.c index 5aebd3ff36d..ec8d29f74c9 100644 --- a/lib/libc/sys/w_waitid.c +++ b/lib/libc/sys/w_waitid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: w_waitid.c,v 1.1 2022/10/26 23:16:24 kettenis Exp $ */ +/* $OpenBSD: w_waitid.c,v 1.2 2022/12/19 03:40:20 guenther Exp $ */ /* * Copyright (c) 2015 Philip Guenther * @@ -25,7 +25,7 @@ waitid(idtype_t idtype, id_t id, siginfo_t *info, int options) ENTER_CANCEL_POINT(1); ret = HIDDEN(waitid)(idtype, id, info, options); - LEAVE_CANCEL_POINT(ret <= 0); + LEAVE_CANCEL_POINT(ret == -1 || info->si_signo == 0); return (ret); } DEF_CANCEL(waitid); -- 2.20.1