diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-22 01:06:59 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-02-22 01:06:59 +0000 |
commit | 848c8c4cec83543073bb2b6ec557220b45d0aebc (patch) | |
tree | 34e52c20b0b9a468962cec0e941af1165762f4a3 /regress/sys/kern/rfork | |
parent | f11b55c15eb66ff9c01d74cc5a0ed1643d5a363f (diff) |
Ugh. fix numerous bugs.
Diffstat (limited to 'regress/sys/kern/rfork')
-rw-r--r-- | regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c | 8 |
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"); |