From: Rafał Długołęcki Date: Sat, 21 Jun 2014 05:58:35 +0000 (+0200) Subject: Add SIGSTOP in SIGTSTP to properly stop the process. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=717e5b533ec94ef8f9a703bd4f019a2f45e138df;p=wsti_so.git Add SIGSTOP in SIGTSTP to properly stop the process. --- 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");