summaryrefslogtreecommitdiff
path: root/regress/sys/kern
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2021-11-27 15:06:11 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2021-11-27 15:06:11 +0000
commitac953d3a48624544d375592e44295a20a0c226b0 (patch)
treeb92f22c9efd4dff67b4146b0c5c938d93fbdbd30 /regress/sys/kern
parentddb0641d47e384e516f09cf825f7201d924a303d (diff)
Fix timeouts in poll/select regress tests
Disable poll/select timeout so that the wchan wait would work as intended. The timeout is not essential to the test flow. In addition, the top-level alarm timer prevents the tests from getting stuck should something go wrong.
Diffstat (limited to 'regress/sys/kern')
-rw-r--r--regress/sys/kern/poll/poll_close.c6
-rw-r--r--regress/sys/kern/select/select_close.c11
2 files changed, 6 insertions, 11 deletions
diff --git a/regress/sys/kern/poll/poll_close.c b/regress/sys/kern/poll/poll_close.c
index a05b0c69b1e..e8dd86864bf 100644
--- a/regress/sys/kern/poll/poll_close.c
+++ b/regress/sys/kern/poll/poll_close.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: poll_close.c,v 1.1 2021/11/21 06:21:01 visa Exp $ */
+/* $OpenBSD: poll_close.c,v 1.2 2021/11/27 15:06:10 visa Exp $ */
/*
* Copyright (c) 2021 Visa Hankala
@@ -88,7 +88,7 @@ thread_main(void *arg)
memset(pfd, 0, sizeof(pfd));
pfd[0].fd = sock[1];
pfd[0].events = POLLIN;
- ret = poll(pfd, 1, 100);
+ ret = poll(pfd, 1, INFTIM);
assert(ret == 1);
assert(pfd[0].revents & POLLIN);
@@ -102,7 +102,7 @@ thread_main(void *arg)
memset(pfd, 0, sizeof(pfd));
pfd[0].fd = sock[1];
pfd[0].events = POLLIN;
- ret = poll(pfd, 1, 100);
+ ret = poll(pfd, 1, INFTIM);
assert(ret == 1);
assert(pfd[0].revents & POLLNVAL);
diff --git a/regress/sys/kern/select/select_close.c b/regress/sys/kern/select/select_close.c
index b06a5a2cb6d..a9e56dd76cf 100644
--- a/regress/sys/kern/select/select_close.c
+++ b/regress/sys/kern/select/select_close.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: select_close.c,v 1.1 2021/11/21 06:21:01 visa Exp $ */
+/* $OpenBSD: select_close.c,v 1.2 2021/11/27 15:06:10 visa Exp $ */
/*
* Copyright (c) 2021 Visa Hankala
@@ -83,15 +83,12 @@ static void *
thread_main(void *arg)
{
fd_set rfds;
- struct timeval tv;
int ret;
char b;
FD_ZERO(&rfds);
FD_SET(sock[1], &rfds);
- tv.tv_sec = 0;
- tv.tv_usec = 100000;
- ret = select(sock[1] + 1, &rfds, NULL, NULL, &tv);
+ ret = select(sock[1] + 1, &rfds, NULL, NULL, NULL);
assert(ret == 1);
assert(FD_ISSET(sock[1], &rfds));
@@ -104,9 +101,7 @@ thread_main(void *arg)
FD_ZERO(&rfds);
FD_SET(sock[1], &rfds);
- tv.tv_sec = 0;
- tv.tv_usec = 100000;
- ret = select(sock[1] + 1, &rfds, NULL, NULL, &tv);
+ ret = select(sock[1] + 1, &rfds, NULL, NULL, NULL);
assert(ret == -1);
assert(errno == EBADF);