]> wimlib.net Git - wimlib/blobdiff - src/hardlink.c
Comments
[wimlib] / src / hardlink.c
index ba4f2e165ce45d0b87a56572b638818fe6a72203..c5324e74ec6c9e9921049c1d3ffcc8c6bc490d2a 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * hardlink.c
+ *
+ * Code to deal with hard links in WIMs.  Essentially, the WIM dentries are put
+ * into a hash table indexed by the hard link group ID field, then for each hard
+ * link group, a linked list is made to connect the dentries.
+ */
+
 /*
  * Copyright (C) 2012 Eric Biggers
  *
@@ -220,9 +228,8 @@ static bool dentries_have_same_ads(const struct dentry *d1,
                if (strcmp(d1->ads_entries[i].stream_name_utf8,
                           d2->ads_entries[i].stream_name_utf8) != 0)
                        return false;
-               if (memcmp(d1->ads_entries[i].hash,
-                          d2->ads_entries[i].hash,
-                          WIM_HASH_SIZE) != 0)
+               if (!hashes_equal(d1->ads_entries[i].hash,
+                                 d2->ads_entries[i].hash))
                        return false;
        }
        return true;
@@ -247,7 +254,7 @@ static int share_dentry_ads(struct dentry *owner, struct dentry *user)
                mismatch_type = "security ID";
                goto mismatch;
        }
-       if (memcmp(owner->hash, user->hash, WIM_HASH_SIZE) != 0) {
+       if (!hashes_equal(owner->hash, user->hash)) {
                mismatch_type = "main file resource";
                goto mismatch;
        }