From 2d82e2a2c609b102b62d27e864a9a2f87df6995b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 29 Aug 2012 00:08:39 +0200 Subject: [PATCH] fix ShellManager, avoid zombie childs when grand childs detaches themselves --- src/shell_manager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 18f7c896..81643dad 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -54,8 +54,8 @@ String ShellManager::pipe(const String& input, close(write_pipe[1]); close(read_pipe[0]); - dup2(read_pipe[1], 1); - dup2(write_pipe[0], 0); + dup2(read_pipe[1], 1); close(read_pipe[1]); + dup2(write_pipe[0], 0); close(write_pipe[0]); boost::regex_iterator it(cmdline.begin(), cmdline.end(), m_regex); boost::regex_iterator end;