| 265 | } |
| 266 | |
| 267 | static bool wait_pid_gone(pid_t pid, int timeout_ms) { |
| 268 | uint64_t deadline = cbm_now_ms() + (uint64_t)timeout_ms; |
| 269 | do { |
| 270 | errno = 0; |
| 271 | if (kill(pid, 0) < 0 && errno == ESRCH) { |
| 272 | return true; |
| 273 | } |
| 274 | subprocess_test_pause(); |
| 275 | } while (cbm_now_ms() < deadline); |
| 276 | errno = 0; |
| 277 | return kill(pid, 0) < 0 && errno == ESRCH; |
| 278 | } |
| 279 | |
| 280 | /* Best-effort cleanup for a failing implementation, so a red tree test does not |
| 281 | * leave its TERM-ignoring probes behind for later tests. The production API must |
no test coverage detected