Skip to content
Browse files

[ARMT] fixed CCommon::RunCommand as it was not reaping it's children

  • Loading branch information...
1 parent 7edbc37 commit a3159fae0820b1fb85f12c52c7e9805cd5ce1d2d @gnif committed Nov 4, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 common/CCommon.cc
View
7 common/CCommon.cc
@@ -376,6 +376,13 @@ bool CCommon::RunCommand(std::string &result, const std::string &cmd, ...)
while((length = read(pipefd[0], buffer, sizeof(buffer))) > 0)
result.append(buffer, length);
+ int status;
+ while(waitpid(pid, &status, 0) > -1)
+ {
+ if (WIFEXITED(status) || WIFSIGNALED(status))
+ break;
+ }
+
close(pipefd[0]);
return true;
}

0 comments on commit a3159fa

Please sign in to comment.
Something went wrong with that request. Please try again.