| 91 | } |
| 92 | |
| 93 | static cbm_private_file_lock_status_t project_lock_failed_acquire( |
| 94 | cbm_project_lock_lease_t *lease, cbm_private_file_lock_status_t status, |
| 95 | cbm_project_lock_lease_t **lease_out) { |
| 96 | if (!lease->project && !lease->project_set) { |
| 97 | free(lease); |
| 98 | return status; |
| 99 | } |
| 100 | cbm_project_lock_lease_t *cleanup = lease; |
| 101 | cbm_private_file_lock_status_t cleanup_status = cbm_project_lock_lease_release(&cleanup); |
| 102 | if (cleanup) { |
| 103 | *lease_out = cleanup; |
| 104 | return CBM_PRIVATE_FILE_LOCK_IO; |
| 105 | } |
| 106 | return cleanup_status == CBM_PRIVATE_FILE_LOCK_OK ? status : CBM_PRIVATE_FILE_LOCK_IO; |
| 107 | } |
| 108 | |
| 109 | static cbm_private_file_lock_status_t project_lock_acquire_internal( |
| 110 | cbm_project_lock_manager_t *manager, const char *project, uint64_t deadline_ms, |
no test coverage detected