From: kettenis Date: Wed, 23 Jun 2021 22:39:31 +0000 (+0000) Subject: Adjust test. You're not supposed to change errno in a signal handler and X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0d411e16797a2c905cfe9dac91dee930dfc51c0d;p=openbsd Adjust test. You're not supposed to change errno in a signal handler and count on it being observable in the normal program flow after the signal handler returns. Such code would break code that sets errno to 0 and looks at its value later. With the recent futex(2) changes this particular aspect of the test no longer passed. ok deraadt@, bluhm@ --- diff --git a/regress/lib/libpthread/errno/errno.c b/regress/lib/libpthread/errno/errno.c index 5ddf05775f8..941e1b713a4 100644 --- a/regress/lib/libpthread/errno/errno.c +++ b/regress/lib/libpthread/errno/errno.c @@ -1,4 +1,4 @@ -/* $OpenBSD: errno.c,v 1.2 2012/02/20 02:34:33 guenther Exp $ */ +/* $OpenBSD: errno.c,v 1.3 2021/06/23 22:39:31 kettenis Exp $ */ /* PUBLIC DOMAIN Sep 2011 */ /* @@ -68,9 +68,7 @@ act_handler(int signal) ASSERT(&errno == t1_errno); ASSERTe(errno, == EXDEV); ASSERT(pthread_equal(t1_tid, pthread_self())); - errno = ENODEV; CHECKe(kill(getpid(), SIGUSR2)); - ASSERTe(errno, == ENODEV); } else if (handler_errno == &t2_errno) { CHECKe(write(STDOUT_FILENO, "2", 1)); ASSERT(&errno == t2_errno); @@ -102,7 +100,6 @@ tmain(void *arg) set_state(T1_SIGNAL); ASSERT(&errno == t1_errno); wait_for_state(T1_CHECK2); - ASSERTe(*t1_errno, == ENODEV); ASSERT(&errno == t1_errno); ASSERT(pthread_equal(t1_tid, pthread_self())); @@ -176,7 +173,6 @@ main(int argc, char **argv) ASSERT(&errno == main_errno); ASSERT(pthread_equal(main_tid, pthread_self())); - handler_errno = &t1_errno; CHECKe(pthread_kill(t1_tid, SIGUSR1)); ASSERT(&errno == main_errno);