Permalink
Browse files

set pid_=-1 after wait, actually implement pid()

Summary: minor issues in folly::Subprocess

Test Plan: subprocess_test

Reviewed By: philipp@fb.com

FB internal diff: D680959
  • Loading branch information...
tudor authored and jdelong committed Jan 16, 2013
1 parent dc6cfb0 commit 36a716b7b1eb8879364d53cdf9d01346e8e493fe
Showing with 5 additions and 0 deletions.
  1. +5 −0 folly/Subprocess.cpp
View
@@ -427,6 +427,7 @@ ProcessReturnCode Subprocess::wait() {
checkUnixError(found, "waitpid");
DCHECK_EQ(found, pid_);
returnCode_ = ProcessReturnCode(status);
+ pid_ = -1;
return returnCode_;
}
@@ -441,6 +442,10 @@ void Subprocess::sendSignal(int signal) {
checkUnixError(r, "kill");
}
+pid_t Subprocess::pid() const {
+ return pid_;
+}
+
namespace {
std::pair<const uint8_t*, size_t> queueFront(const IOBufQueue& queue) {

0 comments on commit 36a716b

Please sign in to comment.