X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fhardlink.c;h=b32309fd407735a262759de7c3a2131b49815082;hb=cfc2cfc859a047e24d002aa149f73d45d4979d24;hp=20faa555c9ea21c5a1c0e17b7dd2fea3e2efd9dc;hpb=038eaccece575d04de8d647bb93773b7f3e38ce4;p=wimlib diff --git a/src/hardlink.c b/src/hardlink.c index 20faa555..b32309fd 100644 --- a/src/hardlink.c +++ b/src/hardlink.c @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2012 Eric Biggers + * + * This file is part of wimlib, a library for working with WIM files. + * + * wimlib is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with wimlib; if not, see http://www.gnu.org/licenses/. + */ + #include "wimlib_internal.h" #include "dentry.h" #include "list.h" @@ -59,8 +78,9 @@ err: * we keep a linked list of the single dentries, and assign them hard link group * IDs later. */ -int link_group_table_insert(struct dentry *dentry, struct link_group_table *table) +int link_group_table_insert(struct dentry *dentry, void *__table) { + struct link_group_table *table = __table; size_t pos; struct link_group *group; @@ -200,9 +220,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; @@ -227,7 +246,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; }