X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FSubprocess.h;h=cdd8e38d25aeacadd117747e10e60ed710f7d99e;hb=95ccc564c5c70715ca9d499e93147dc2f8d72b8f;hp=0354b4b21e56d11450fbd2db98fc41650ac33de4;hpb=b10e3e8663d4d7cb8ca7246db980b5f3e5e7bb97;p=folly.git diff --git a/folly/Subprocess.h b/folly/Subprocess.h index 0354b4b2..cdd8e38d 100644 --- a/folly/Subprocess.h +++ b/folly/Subprocess.h @@ -126,12 +126,18 @@ class ProcessReturnCode { friend class Subprocess; public: enum State { + // Subprocess starts in the constructor, so this state designates only + // default-initialized or moved-out ProcessReturnCodes. NOT_STARTED, RUNNING, EXITED, KILLED }; + // Default-initialized for convenience. Subprocess::returnCode() will + // never produce this value. + ProcessReturnCode() : ProcessReturnCode(RV_NOT_STARTED) {} + // Trivially copyable ProcessReturnCode(const ProcessReturnCode& p) = default; ProcessReturnCode& operator=(const ProcessReturnCode& p) = default; @@ -209,7 +215,7 @@ class CalledProcessError : public SubprocessError { public: explicit CalledProcessError(ProcessReturnCode rc); ~CalledProcessError() throw() = default; - const char* what() const throw() FOLLY_OVERRIDE { return what_.c_str(); } + const char* what() const throw() override { return what_.c_str(); } ProcessReturnCode returnCode() const { return returnCode_; } private: ProcessReturnCode returnCode_; @@ -223,7 +229,7 @@ class SubprocessSpawnError : public SubprocessError { public: SubprocessSpawnError(const char* executable, int errCode, int errnoValue); ~SubprocessSpawnError() throw() = default; - const char* what() const throw() FOLLY_OVERRIDE { return what_.c_str(); } + const char* what() const throw() override { return what_.c_str(); } int errnoValue() const { return errnoValue_; } private: