diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-03-08 21:15:37 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-03-08 21:15:37 +0000 |
| commit | f2fd2b125aceb992548c817f9563805401a4436a (patch) | |
| tree | 757d24df2bbd236adbac0f434ac841a09c054f98 /src/command_manager.cc | |
| parent | 97648b1fdaadbfe64f490b519612a84cadbd7090 (diff) | |
support read error in shell_eval
Diffstat (limited to 'src/command_manager.cc')
| -rw-r--r-- | src/command_manager.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/command_manager.cc b/src/command_manager.cc index ac3e1b89..3285c8c8 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -116,7 +116,11 @@ static void shell_eval(std::vector<std::string>& params, std::string output; char buffer[1024]; while (size_t size = read(read_pipe[0], buffer, 1024)) + { + if (size == -1) + break; output += std::string(buffer, buffer+size); + } close(read_pipe[0]); waitpid(pid, NULL, 0); |
