| 1589 | } |
| 1590 | |
| 1591 | static bool main_local_transition_close(cbm_daemon_ipc_local_transition_t **transition) { |
| 1592 | uint64_t deadline = main_deadline_after(MAIN_COORDINATION_CLEANUP_MS); |
| 1593 | while (transition && *transition) { |
| 1594 | /* A failed release always RETAINS the transition and is retriable by |
| 1595 | * contract: the Windows release transition must briefly try-hold the |
| 1596 | * shared startup-v2/legacy gates, so concurrent one-shot teardowns |
| 1597 | * legitimately collide and succeed on retry. Success consumes the |
| 1598 | * transition; only never-finishing cleanup is a failure, and the |
| 1599 | * deadline escalation below owns that. */ |
| 1600 | (void)cbm_daemon_ipc_local_transition_release(transition); |
| 1601 | if (*transition) { |
| 1602 | if (cbm_now_ms() >= deadline) { |
| 1603 | main_coordination_cleanup_fail_stop("local_transition_cleanup"); |
| 1604 | } |
| 1605 | cbm_usleep(1000); |
| 1606 | } |
| 1607 | } |
| 1608 | return true; |
| 1609 | } |
| 1610 | |
| 1611 | static bool main_session_context(const char *preferred_root, char root_out[MAIN_PATH_CAP], |
| 1612 | char allowed_out[MAIN_PATH_CAP], const char **allowed_out_ptr) { |
no test coverage detected