From 6aa4bd2ff5e70b2067baaed720c9e64b63f62767 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Thu, 8 Oct 2020 19:27:19 +0200 Subject: When resuming a child, resume the whole group SIGTSTP is sent to the entire foreground process group, so do the some with our SIGCONT. Debian's default sh (dash) doesn't replace itself with the command, even if it's the last one in the -c option. Of course, we do not need to use /bin/sh for the helpers at all, though it doesn't cost us much. We could also issue an explicit `exec`. --- sdn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdn.cpp b/sdn.cpp index 83fbbd1..fdbb1f7 100644 --- a/sdn.cpp +++ b/sdn.cpp @@ -888,7 +888,7 @@ fun run_program (initializer_list list, const string &filename) { // We don't provide job control--don't let us hang after ^Z while (waitpid (child, &status, WUNTRACED) > -1 && WIFSTOPPED (status)) if (WSTOPSIG (status) == SIGTSTP) - kill (child, SIGCONT); + kill (-child, SIGCONT); tcsetpgrp (STDOUT_FILENO, getpgid (0)); if (WIFEXITED (status) && WEXITSTATUS (status)) { -- cgit v1.2.3-70-g09d2