]> wimlib.net Git - wimlib/blobdiff - src/verify.c
LZMS: Do not do x86 translations starting in last 16 bytes
[wimlib] / src / verify.c
index 3702ee7e995fa15af359f0a457c6dde174c5a7c3..a9de114642138b6aa1bbcb2c9b1f8b012c0366e6 100644 (file)
@@ -39,6 +39,9 @@
  * - Check to make sure the security ID is valid
  * - Check to make sure there is at most one unnamed stream
  * - Check to make sure there is at most one DOS name.
+ *
+ * Return values:
+ *     WIMLIB_ERR_SUCCESS (0)
  */
 int
 verify_inode(struct wim_inode *inode, const struct wim_security_data *sd)
@@ -86,7 +89,7 @@ verify_inode(struct wim_inode *inode, const struct wim_security_data *sd)
                                      "both `%"TS"' and `%"TS"'",
                                      dentry_full_path(dentry_with_dos_name),
                                      dentry_full_path(dentry));
-                               return WIMLIB_ERR_INVALID_DENTRY;
+                               return WIMLIB_ERR_INVALID_METADATA_RESOURCE;
                        #else
                                dentry->dos_name_invalid = 1;
                        #endif
@@ -148,13 +151,16 @@ tally_image_refcnts(WIMStruct *wim)
  * problem by looking at ALL the images to re-calculate the reference count of
  * EVERY lookup table entry.  This only absolutely has to be done before an image
  * is deleted or before an image is mounted read-write. */
-void
+int
 wim_recalculate_refcnts(WIMStruct *wim)
 {
        unsigned long num_ltes_with_bogus_refcnt = 0;
+       int ret;
 
        for_lookup_table_entry(wim->lookup_table, lte_zero_real_refcnt, NULL);
-       for_image(wim, WIMLIB_ALL_IMAGES, tally_image_refcnts);
+       ret = for_image(wim, WIMLIB_ALL_IMAGES, tally_image_refcnts);
+       if (ret)
+               return ret;
        num_ltes_with_bogus_refcnt = 0;
        for_lookup_table_entry(wim->lookup_table, lte_fix_refcnt,
                               &num_ltes_with_bogus_refcnt);
@@ -165,4 +171,5 @@ wim_recalculate_refcnts(WIMStruct *wim)
                        num_ltes_with_bogus_refcnt);
        }
        wim->refcnts_ok = 1;
+       return 0;
 }