From 24519e645e2ca2cb96b7b9e45703045f27521ff0 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 3 Dec 2014 13:57:04 +0000 Subject: [PATCH] Revert "Handle SIGCHLD signals when piping" This reverts commit 8208e75294b4eb016ae578f9ae132d9f8dfe4785. --- src/shell_manager.cc | 12 +----------- 1 file changed, 1 insertion(+), 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))