From fe4c4e337e547b627e52006cc082769558f21411 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 14 Feb 2024 14:36:16 +0100 Subject: [PATCH] remove infinite loop in t_stopcont Remove useless preprocessor define. Terminate the child after 15 seconds. Since the parent is waiting for the child to terminate it is still guaranteed that the child was continued. --- programs/tests/t_stopcont.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/programs/tests/t_stopcont.c b/programs/tests/t_stopcont.c index 2520c95..c9e5460 100644 --- a/programs/tests/t_stopcont.c +++ b/programs/tests/t_stopcont.c @@ -41,18 +41,16 @@ int main(int argc, char *argv[]) sleep(2); printf("Sending stop sig to child\n"); -#if 1 if (kill(child_pid, SIGSTOP) == -1) printf("Errore invio stop\n"); -#endif wait(NULL); } else { - int c = 0; - for (;;) { - printf("c: %d\n", c++); + for (int c = 0; c < 5; c++) { + printf("c: %d\n", c); sleep(3); } + exit(0); } return 0;