| 64 | } |
| 65 | |
| 66 | ssize_t SubProcess::read(char* buf, size_t len) { |
| 67 | if (stdout_fd_ < 0) |
| 68 | return -1; |
| 69 | |
| 70 | const ssize_t n = ::read(stdout_fd_, buf, len); |
| 71 | if (n < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) |
| 72 | return 0; |
| 73 | return n; |
| 74 | } |
| 75 | |
| 76 | bool SubProcess::is_running() const { |
| 77 | if (pid_ <= 0) |
no test coverage detected