If the test fails, do not hang forever. Abort with a 10 seconds
authorbluhm <bluhm@openbsd.org>
Fri, 29 Oct 2021 20:15:03 +0000 (20:15 +0000)
committerbluhm <bluhm@openbsd.org>
Fri, 29 Oct 2021 20:15:03 +0000 (20:15 +0000)
timeout.

regress/sys/kern/poll/pollnval.c

index adc9132..95be7ea 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pollnval.c,v 1.1 2021/10/29 13:13:04 mpi Exp $        */
+/*     $OpenBSD: pollnval.c,v 1.2 2021/10/29 20:15:03 bluhm Exp $      */
 
 /*
  * Copyright (c) 2021 Leah Neukirchen <leah@vuxu.org>
@@ -26,6 +26,9 @@ main(void)
 {
        struct pollfd fds[1];
 
+       /* Do not hang forever, abort with timeout. */
+       alarm(10);
+
        fds[0].fd = 0;
        fds[0].events = POLLIN | POLLHUP;
        close(0);