summaryrefslogtreecommitdiff
path: root/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c')
-rw-r--r--regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c b/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c
index 86fd1217303..373a98767d2 100644
--- a/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c
+++ b/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfmem-stack.c,v 1.2 2002/02/21 21:14:37 art Exp $ */
+/* $OpenBSD: rfmem-stack.c,v 1.3 2002/02/22 01:06:58 art Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
*/
@@ -31,11 +31,15 @@ main()
case 0:
memcpy(map, MAGIC, sizeof(MAGIC));
sleep(1);
- if (memcmp(map2, MAGIC, sizeof(MAGIC)) == 0);
+ if (memcmp(map2, MAGIC, sizeof(MAGIC)) == 0) {
write(2, "child stack polluted\n", 21);
+ _exit(1);
+ }
_exit(0);
}
+ memcpy(map2, MAGIC, sizeof(MAGIC));
+
if (wait(&status) < 0)
err(1, "wait");