| 675 | } |
| 676 | |
| 677 | static bool wait_pid_gone(pid_t pid, int timeout_ms) { |
| 678 | uint64_t deadline = cbm_now_ms() + (uint64_t)timeout_ms; |
| 679 | do { |
| 680 | errno = 0; |
| 681 | if (kill(pid, 0) < 0 && errno == ESRCH) { |
| 682 | return true; |
| 683 | } |
| 684 | subprocess_test_pause(); |
| 685 | } while (cbm_now_ms() < deadline); |
| 686 | errno = 0; |
| 687 | return kill(pid, 0) < 0 && errno == ESRCH; |
| 688 | } |
| 689 | |
| 690 | /* Best-effort cleanup for a failing implementation, so a red tree test does not |
| 691 | * leave its TERM-ignoring probes behind for later tests. The production API must |
no test coverage detected