summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-26 13:32:06 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-26 13:32:06 +0000
commitfe88819cde51dc180b6aed3bf1240375032fd8a4 (patch)
treee4e9cbbbea28f7d742f4698243c45fcbaa5f722e /regress/sys
parent2ba7396567e2763069e55a56d3a2f42ab6a49458 (diff)
Fix compiler warnings with sparc64 gcc 4.2.1.
Diffstat (limited to 'regress/sys')
-rw-r--r--regress/sys/kern/poll/pollretval.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/regress/sys/kern/poll/pollretval.c b/regress/sys/kern/poll/pollretval.c
index 9d2d4cae0f3..1cb71970fbf 100644
--- a/regress/sys/kern/poll/pollretval.c
+++ b/regress/sys/kern/poll/pollretval.c
@@ -1,3 +1,5 @@
+/* $OpenBSD: pollretval.c,v 1.2 2021/12/26 13:32:05 bluhm Exp $ */
+
#include <stdio.h>
#include <poll.h>
#include <unistd.h>
@@ -5,24 +7,26 @@
#include <err.h>
int
-main()
+main(void)
{
- struct pollfd pfd[100];
- int i, r, r2 = 0;
+ struct pollfd pfd[100];
+ int i, r, r2 = 0;
- for (i = 0; i < 100; i++) {
- pfd[i].fd = 0;
- pfd[i].events = arc4random() % 0x177;
- }
+ for (i = 0; i < 100; i++) {
+ pfd[i].fd = 0;
+ pfd[i].events = arc4random() % 0x177;
+ }
r = poll(pfd, 100, INFTIM);
if (r == -1)
errx(1, "poll failed unexpectedly");
- for (i = 0; i < 100; i++)
+ for (i = 0; i < 100; i++)
if (pfd[i].revents)
r2++;
if (r != r2)
errx(1, "poll return value %d miscounts .revents %d", r, r2);
+
+ return 0;
}