From 717e5b533ec94ef8f9a703bd4f019a2f45e138df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20D=C5=82ugo=C5=82=C4=99cki?= Date: Sat, 21 Jun 2014 07:58:35 +0200 Subject: [PATCH] Add SIGSTOP in SIGTSTP to properly stop the process. --- src/process1.c | 1 + src/process2.c | 1 + src/process3.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/process1.c b/src/process1.c index aa27e8c..9fdee30 100644 --- a/src/process1.c +++ b/src/process1.c @@ -42,6 +42,7 @@ void sig_handler(int signo) else if (signo == SIGTSTP) { fprintf(stderr, "[%s] > Closing pipe\n", "process1"); close(write_pipe); + raise (SIGSTOP); } else if (signo == SIGCONT) { fprintf(stderr, "[%s] > Opening pipe\n", "process1"); diff --git a/src/process2.c b/src/process2.c index 87871e7..4908173 100644 --- a/src/process2.c +++ b/src/process2.c @@ -42,6 +42,7 @@ void sig_handler(int signo) fprintf(stderr, "[%s] > Closing pipes\n", "process2"); close(read_descriptor); close(write_descriptor); + raise (SIGSTOP); } else if (signo == SIGCONT) { fprintf(stderr, "[%s] > Opening pipes\n", "process2"); diff --git a/src/process3.c b/src/process3.c index b75f903..12efd40 100644 --- a/src/process3.c +++ b/src/process3.c @@ -31,6 +31,7 @@ void sig_handler(int signo) else if (signo == SIGTSTP) { fprintf(stderr, "[%s] > Closing pipe\n", "process3"); close(read_descriptor); + raise (SIGSTOP); } else if (signo == SIGCONT) { fprintf(stderr, "[%s] > Opening pipe\n", "process3"); -- 2.30.2