From: Karel Zak Date: Fri, 12 Nov 2021 10:50:41 +0000 (+0100) Subject: hardlink: add verbose messages when skip file X-Git-Tag: v2.38-rc1~170 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af5f0078fd621688ccf1e0eb9b52b452f9fa419b;p=thirdparty%2Futil-linux.git hardlink: add verbose messages when skip file Signed-off-by: Karel Zak --- diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c index b1ba70c680..7c11f644a5 100644 --- a/misc-utils/hardlink.c +++ b/misc-utils/hardlink.c @@ -850,9 +850,15 @@ static void visitor(const void *nodep, const VISIT which, const int depth) assert(other != other->next); assert(other->st.st_size == master->st.st_size); + if (!other->links) + continue; + /* check file attributes, etc. */ - if (!other->links || !file_may_link_to(master, other)) + if (!file_may_link_to(master, other)) { + jlog(JLOG_VERBOSE2, + _("Skipped (attributes mismatch) %s"), other->links->path); continue; + } /* initialize content comparison */ if (!ul_fileeq_data_associated(&master->data)) @@ -868,8 +874,11 @@ static void visitor(const void *nodep, const VISIT which, const int depth) stats.comparisons++; - if (!eq) + if (!eq) { + jlog(JLOG_VERBOSE2, + _("Skipped (content mismatch) %s"), other->links->path); continue; + } /* link files */ if (!file_link(master, other) && errno == EMLINK) {