diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-12-03 13:57:04 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-12-03 13:57:04 +0000 |
| commit | 24519e645e2ca2cb96b7b9e45703045f27521ff0 (patch) | |
| tree | 3f24ef415ae9cab3da9c163194732314eac73048 /src/shell_manager.cc | |
| parent | 0517a19e6d6911d8d516a7a554aad829bf78a431 (diff) | |
Revert "Handle SIGCHLD signals when piping"
This reverts commit 8208e75294b4eb016ae578f9ae132d9f8dfe4785.
Diffstat (limited to 'src/shell_manager.cc')
| -rw-r--r-- | src/shell_manager.cc | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/shell_manager.cc b/src/shell_manager.cc index f037371c..afc43324 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -50,10 +50,6 @@ String ShellManager::pipe(StringView input, ::pipe(read_pipe); ::pipe(error_pipe); - static sig_atomic_t exited; exited = 0; - static sig_atomic_t sig_exit_status; - signal(SIGCHLD, [](int) { wait(&sig_exit_status); exited = 1; }); - String output; if (pid_t pid = fork()) { @@ -86,13 +82,7 @@ String ShellManager::pipe(StringView input, if (not error.empty()) write_debug("shell stderr: <<<\n" + error + ">>>"); - signal(SIGCHLD, SIG_DFL); - - if (not exited) - waitpid(pid, exit_status, 0); - else if (exit_status) - *exit_status = sig_exit_status; - + waitpid(pid, exit_status, 0); if (exit_status) { if (WIFEXITED(*exit_status)) |
