]> wimlib.net Git - wimlib/blobdiff - src/wim.c
wim_inode: Move file descriptors table into union
[wimlib] / src / wim.c
index 7927af3cd41ac2cc526050cff8bdaa5a467328ee..a745c0a2558a42f2eaddefaaa5f63f724ed32a3e 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -159,6 +159,7 @@ wimlib_create_new_wim(int ctype, WIMStruct **w_ret)
                goto out_free;
        }
        w->lookup_table = table;
+       w->refcnts_ok = 1;
        *w_ret = w;
        return 0;
 out_free:
@@ -467,6 +468,12 @@ begin_read(WIMStruct *w, const tchar *in_wim_path, int open_flags,
        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)
@@ -475,7 +482,7 @@ begin_read(WIMStruct *w, const tchar *in_wim_path, int open_flags,
 
        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;
        }
 
@@ -740,9 +747,11 @@ can_delete_from_wim(WIMStruct *wim)
        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