| 304 | } |
| 305 | |
| 306 | static bool wait_pid_gone(pid_t pid, int timeout_ms) { |
| 307 | uint64_t deadline = cbm_now_ms() + (uint64_t)timeout_ms; |
| 308 | do { |
| 309 | errno = 0; |
| 310 | if (kill(pid, 0) < 0 && errno == ESRCH) { |
| 311 | return true; |
| 312 | } |
| 313 | subprocess_test_pause(); |
| 314 | } while (cbm_now_ms() < deadline); |
| 315 | errno = 0; |
| 316 | return kill(pid, 0) < 0 && errno == ESRCH; |
| 317 | } |
| 318 | |
| 319 | /* Best-effort cleanup for a failing implementation, so a red tree test does not |
| 320 | * leave its TERM-ignoring probes behind for later tests. The production API must |
no test coverage detected