Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit a3159fae0820b1fb85f12c52c7e9805cd5ce1d2d 1 parent 7edbc37
@gnif authored
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.