Improve waitpid error handling
authorAlexey Spiridonov <lesha@fb.com>
Mon, 27 Jul 2015 02:32:03 +0000 (19:32 -0700)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Mon, 27 Jul 2015 03:22:10 +0000 (20:22 -0700)
commitb10e3e8663d4d7cb8ca7246db980b5f3e5e7bb97
tree8e8254e56a239706d45b06caf286b16f6ed56a5a
parent7b481d96d66a295cbc18736c7520795813d70289
Improve waitpid error handling

Summary: Using `checkUnixError` after `waitpid()` is confusing and useless, because the only two possible errors are `ECHILD` (some other part of the program waited for this process!?) and `EINVAL` (invalid options, which are hardcoded in both `Subprocess::wait()` and `poll()`). Neither of these are recoverable. Moreover, even if the caller catches the exception, `~Subprocess` is still booby-trapped to `abort()` since its status remains `RUNNING`.

In short, just abort.

Reviewed By: @yfeldblum

Differential Revision: D2079415
folly/Subprocess.cpp
folly/Subprocess.h