| 434 | } |
| 435 | |
| 436 | void Process::close_fds() noexcept { |
| 437 | if(stdout_stderr_thread.joinable()) |
| 438 | stdout_stderr_thread.join(); |
| 439 | |
| 440 | if(stdin_fd) |
| 441 | close_stdin(); |
| 442 | if(stdout_fd) { |
| 443 | if(data.id > 0) |
| 444 | close(*stdout_fd); |
| 445 | stdout_fd.reset(); |
| 446 | } |
| 447 | if(stderr_fd) { |
| 448 | if(data.id > 0) |
| 449 | close(*stderr_fd); |
| 450 | stderr_fd.reset(); |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | bool Process::write(const char *bytes, size_t n) { |
| 455 | if(!open_stdin) |