| 230 | } |
| 231 | |
| 232 | static bool make_tree_pid_path(char path[64]) { |
| 233 | strcpy(path, "/tmp/cbm-subprocess-tree-XXXXXX"); |
| 234 | int fd = cbm_mkstemp(path); |
| 235 | if (fd < 0) { |
| 236 | return false; |
| 237 | } |
| 238 | (void)close(fd); |
| 239 | return unlink(path) == 0; /* child creates it only after both traps are installed */ |
| 240 | } |
| 241 | |
| 242 | static bool wait_for_tree_pids(const char *path, cbm_subprocess_t *process, pid_t *parent_pid, |
| 243 | pid_t *grandchild_pid, int timeout_ms) { |
no test coverage detected