From ac2676cbcfa3be81b6136efc28b009bc25489c30 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 31 Jul 2012 14:21:25 +0200 Subject: [PATCH] ShellManager: catch all exception once we are in child process --- src/shell_manager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 265a8440..a8d1d2df 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -49,7 +49,7 @@ String ShellManager::pipe(const String& input, close(read_pipe[0]); waitpid(pid, NULL, 0); } - else + else try { close(write_pipe[1]); close(read_pipe[0]); @@ -95,7 +95,9 @@ String ShellManager::pipe(const String& input, } execlp("sh", "sh", "-c", cmdline.c_str(), NULL); + exit(-1); } + catch (...) { exit(-1); } return output; }