| 274 | } |
| 275 | |
| 276 | Subprocess::~Subprocess() { |
| 277 | if (state_ == kRunning) { |
| 278 | LOG(WARNING) << Substitute( |
| 279 | "Child process $0 ($1) was orphaned. Sending signal $2...", |
| 280 | child_pid_.load(), JoinStrings(argv_, " "), sig_on_destruct_); |
| 281 | WARN_NOT_OK(KillAndWait(sig_on_destruct_), |
| 282 | Substitute("Failed to KillAndWait() with signal $0", |
| 283 | sig_on_destruct_)); |
| 284 | } |
| 285 | |
| 286 | for (int i = 0; i < 3; ++i) { |
| 287 | if (fd_state_[i] == PIPED && child_fds_[i] >= 0) { |
| 288 | int ret; |
| 289 | RETRY_ON_EINTR(ret, close(child_fds_[i])); |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | #if defined(__APPLE__) |
| 295 | static int pipe2(int pipefd[2], int flags) { |
nothing calls this directly
no test coverage detected