| 184 | } |
| 185 | |
| 186 | static bool reap(Child *child, bool terminate, int *status, bool *reaped) { |
| 187 | if (child->pid < 0) |
| 188 | return true; |
| 189 | bool ok = true; |
| 190 | if (terminate && kill(child->pid, SIGKILL) != 0 && errno != ESRCH) |
| 191 | ok = false; |
| 192 | pid_t result; |
| 193 | do { |
| 194 | result = waitpid(child->pid, status, 0); |
| 195 | } while (result < 0 && errno == EINTR); |
| 196 | if (result == child->pid || (result < 0 && errno == ECHILD)) |
| 197 | *reaped = true; |
| 198 | return result == child->pid && ok; |
| 199 | } |
| 200 | |
| 201 | static bool profile_paths(Child *child, const char *root, const char *stem) { |
| 202 | return path_fits(snprintf(child->profile, sizeof(child->profile), "%s/%s/%s.%ld.profraw", root, |
no outgoing calls
no test coverage detected