From 8a903f1e2cfe16634c60ade801410303d2d08723 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Fri, 14 Apr 2023 02:00:56 +0800 Subject: [TESTS] Make test09 deterministic (#698) --- tests/test09 | Bin 16744 -> 16088 bytes tests/test09.c | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test09 b/tests/test09 index cf9d6c2c..7855a69d 100755 Binary files a/tests/test09 and b/tests/test09 differ diff --git a/tests/test09.c b/tests/test09.c index e4a56050..dadff215 100755 --- a/tests/test09.c +++ b/tests/test09.c @@ -1,5 +1,6 @@ #include -#include +#include +#include #include void forkexample() @@ -9,7 +10,7 @@ void forkexample() if (fork() == 0) printf("Child has x = %d\n", ++x); else { - usleep(20000); + wait(NULL); printf("Parent has x = %d\n", --x); } } @@ -17,4 +18,4 @@ int main() { forkexample(); return 0; -} \ No newline at end of file +} -- cgit 1.4.1