| 214 | } |
| 215 | |
| 216 | static bool reap(Fixture *f, bool terminate) { |
| 217 | if (f->pid < 0 || f->reaped) |
| 218 | return true; |
| 219 | bool ok = true; |
| 220 | if (terminate && kill(f->pid, SIGKILL) != 0 && errno != ESRCH) |
| 221 | ok = false; |
| 222 | pid_t result; |
| 223 | do { |
| 224 | result = waitpid(f->pid, &f->status, 0); |
| 225 | } while (result < 0 && errno == EINTR); |
| 226 | if (result == f->pid || (result < 0 && errno == ECHILD)) |
| 227 | f->reaped = true; |
| 228 | return result == f->pid && ok; |
| 229 | } |
| 230 | |
| 231 | static bool observe_and_release(Fixture *f, const char *root, const char *test) { |
| 232 | int n = snprintf(f->marker, sizeof(f->marker), "%s/%s/%s.%ld.forked", root, tf_current_suite, |
no outgoing calls
no test coverage detected