| 1355 | } |
| 1356 | |
| 1357 | static bool main_local_transition_close(cbm_daemon_ipc_local_transition_t **transition) { |
| 1358 | uint64_t deadline = main_deadline_after(MAIN_COORDINATION_CLEANUP_MS); |
| 1359 | while (transition && *transition) { |
| 1360 | /* A failed release always RETAINS the transition and is retriable by |
| 1361 | * contract: the Windows release transition must briefly try-hold the |
| 1362 | * shared startup-v2/legacy gates, so concurrent one-shot teardowns |
| 1363 | * legitimately collide and succeed on retry. Success consumes the |
| 1364 | * transition; only never-finishing cleanup is a failure, and the |
| 1365 | * deadline escalation below owns that. */ |
| 1366 | (void)cbm_daemon_ipc_local_transition_release(transition); |
| 1367 | if (*transition) { |
| 1368 | if (cbm_now_ms() >= deadline) { |
| 1369 | main_coordination_cleanup_fail_stop("local_transition_cleanup"); |
| 1370 | } |
| 1371 | cbm_usleep(1000); |
| 1372 | } |
| 1373 | } |
| 1374 | return true; |
| 1375 | } |
| 1376 | |
| 1377 | static bool main_session_context(const char *preferred_root, char root_out[MAIN_PATH_CAP], |
| 1378 | char allowed_out[MAIN_PATH_CAP], const char **allowed_out_ptr) { |
no test coverage detected