summaryrefslogtreecommitdiff
path: root/regress/sys/kern/kqueue
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-06-12 04:52:41 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-06-12 04:52:41 +0000
commited00071561fdffa8e0a37a9244a8890e9684b206 (patch)
tree3d4d66af2e4fcb31e4a237cf79b2ee8a9a47d769 /regress/sys/kern/kqueue
parent5d7ad18d563a5ea71803eae19884876fbda5ac91 (diff)
-Wall and calc fix in the random
Diffstat (limited to 'regress/sys/kern/kqueue')
-rw-r--r--regress/sys/kern/kqueue/kqueue-process.c8
-rw-r--r--regress/sys/kern/kqueue/kqueue-random.c6
2 files changed, 9 insertions, 5 deletions
diff --git a/regress/sys/kern/kqueue/kqueue-process.c b/regress/sys/kern/kqueue/kqueue-process.c
index e993d282ce2..3fc9b016edf 100644
--- a/regress/sys/kern/kqueue/kqueue-process.c
+++ b/regress/sys/kern/kqueue/kqueue-process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-process.c,v 1.2 2002/06/11 06:16:36 jsyn Exp $ */
+/* $OpenBSD: kqueue-process.c,v 1.3 2003/06/12 04:52:40 mickey Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain
*/
@@ -67,6 +67,7 @@ do_process(void)
didfork = didchild = 0;
+ pid2 = -1;
for (i = 0; i < 2; i++) {
ASS(kevent(kq, NULL, 0, &ke, 1, &ts) == 1,
warnx("didn't receive event"));
@@ -91,6 +92,9 @@ do_process(void)
}
}
+ if (pid2 == -1)
+ return (1);
+
/* Both children now sleeping. */
ASSX(didchild == didfork == 1);
@@ -122,7 +126,7 @@ process_child(void)
case 0:
/* sync 2.1 */
pause();
- execl("/usr/bin/true", "true", NULL);
+ execl("/usr/bin/true", "true", (void *)NULL);
err(1, "execl(true)");
}
diff --git a/regress/sys/kern/kqueue/kqueue-random.c b/regress/sys/kern/kqueue/kqueue-random.c
index 44f77dee9c6..655fc3c4ad7 100644
--- a/regress/sys/kern/kqueue/kqueue-random.c
+++ b/regress/sys/kern/kqueue/kqueue-random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-random.c,v 1.1 2002/06/19 03:05:07 mickey Exp $ */
+/* $OpenBSD: kqueue-random.c,v 1.2 2003/06/12 04:52:40 mickey Exp $ */
/* Copyright (c) 2002 Michael Shalayeff, Public Domain */
#include <stdlib.h>
@@ -16,7 +16,7 @@
int
do_random(void)
{
- int n, fd, kq, status;
+ int n, fd, kq;
struct timespec ts;
struct kevent ev;
u_int32_t buf[POOLWORDS];
@@ -55,7 +55,7 @@ do_random(void)
return (1);
}
- n = MIN((ev.data + 31) / 32, sizeof(buf));
+ n = MIN((ev.data + 7) / 8, sizeof(buf));
if (read(fd, buf, n) < 1)
return (1);