goto out_free;
}
w->lookup_table = table;
+ w->refcnts_ok = 1;
*w_ret = w;
return 0;
out_free:
if (ret)
return ret;
+ if (w->hdr.flags & WIM_HDR_FLAG_WRITE_IN_PROGRESS) {
+ WARNING("The WIM_HDR_FLAG_WRITE_IN_PROGRESS is set in the header of \"%"TS"\".\n"
+ " It may be being changed by another process, or a process\n"
+ " may have crashed while writing the WIM.", in_wim_path);
+ }
+
if (open_flags & WIMLIB_OPEN_FLAG_WRITE_ACCESS) {
ret = can_modify_wim(w);
if (ret)
if (w->hdr.total_parts != 1 && !(open_flags & WIMLIB_OPEN_FLAG_SPLIT_OK)) {
ERROR("\"%"TS"\": This WIM is part %u of a %u-part WIM",
- w->filename, w->hdr.part_number, w->hdr.total_parts);
+ in_wim_path, w->hdr.part_number, w->hdr.total_parts);
return WIMLIB_ERR_SPLIT_UNSUPPORTED;
}
int ret;
ret = can_modify_wim(wim);
- if (ret == 0 && !wim->all_images_verified)
- ret = wim_run_full_verifications(wim);
- return ret;
+ if (ret)
+ return ret;
+ if (!wim->refcnts_ok)
+ wim_recalculate_refcnts(wim);
+ return 0;
}
/* Frees the memory for the WIMStruct, including all internal memory; also