| 4979 | } |
| 4980 | |
| 4981 | static cbm_pipeline_frozen_status_t frozen_commit(cbm_pipeline_t *p, const char *stage) { |
| 4982 | int rc = p->rename_hook ? p->rename_hook(stage, p->db_path, p->rename_hook_ctx) |
| 4983 | : cbm_rename_noreplace(stage, p->db_path); |
| 4984 | if (rc != 0) { |
| 4985 | cbm_pipeline_frozen_status_t absence = frozen_absent_destination(p->db_path); |
| 4986 | return absence == CBM_PIPELINE_FROZEN_DEST_EXISTS ? absence : CBM_PIPELINE_FROZEN_IO; |
| 4987 | } |
| 4988 | cbm_path_info_t info; |
| 4989 | if (cbm_path_info_utf8(p->db_path, &info) != CBM_PATH_INFO_OK || !info.is_regular || |
| 4990 | info.is_symlink || cbm_path_info_utf8(stage, &info) != CBM_PATH_INFO_ABSENT) |
| 4991 | return CBM_PIPELINE_FROZEN_IO; |
| 4992 | return stage_owner_release(stage) == 0 ? CBM_PIPELINE_FROZEN_OK : CBM_PIPELINE_FROZEN_IO; |
| 4993 | } |
| 4994 | |
| 4995 | static cbm_pipeline_frozen_status_t frozen_build_locked(cbm_pipeline_frozen_t *owner) { |
| 4996 | cbm_pipeline_t *p = owner->pipeline; |
no test coverage detected