diff options
| -rwxr-xr-x | tests/test09 | bin | 16744 -> 16088 bytes | |||
| -rwxr-xr-x | tests/test09.c | 7 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/test09 b/tests/test09 index cf9d6c2c..7855a69d 100755 --- a/tests/test09 +++ b/tests/test09 Binary files differdiff --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 <stdio.h> -#include <sys/types.h> +#include <sys/types.h> +#include <sys/wait.h> #include <unistd.h> 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 +} |