mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-04-27 20:05:12 +00:00
Use Gnulib’s same-inode module
This is more portable to non-POSIX systems. However, don’t bother trying to port to systems where st_ino is not a scalar of type dev_t, as these systems no longer seem to be active targets and it’s not worth the maintenance hassle. * gnulib.modules: Add same-inode, now that we use it explicitly rather than indirectly. * src/compare.c (diff_link): * src/create.c (compare_links, restore_parent_fd): * src/incremen.c (compare_directory_meta, procdir): * src/extract.c (dl_compare, repair_delayed_set_stat) (apply_nonancestor_delayed_set_stat, extract_link) (apply_delayed_link): * src/names.c (add_file_id): * src/system.c (sys_file_is_archive, sys_detect_dev_null_output): Include same-inode.h, and prefer its macros and functions to doing things by hand. * src/create.c (struct link): * src/extract.c (struct delayed_set_stat, struct delayed_link): * src/incremen.c (struct directory): * src/names.c (struct file_id_list): Rename members to st_dev and st_ino so that SAME_INODE and PSAME_INODE can be used on the type. All uses changed. * src/system.c (sys_compare_links): Remove. All uses replaced by psame_inode.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <alignalloc.h>
|
||||
#include <quotearg.h>
|
||||
#include <rmt.h>
|
||||
#include <same-inode.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Nonzero if we are verifying at the moment. */
|
||||
@@ -251,7 +252,7 @@ diff_link (void)
|
||||
|
||||
if (get_stat_data (current_stat_info.file_name, &file_data)
|
||||
&& get_stat_data (current_stat_info.link_name, &link_data)
|
||||
&& !sys_compare_links (&file_data, &link_data))
|
||||
&& !psame_inode (&file_data, &link_data))
|
||||
report_difference (¤t_stat_info,
|
||||
_("Not linked to %s"),
|
||||
quote_n_colon (QUOTE_ARG,
|
||||
|
||||
Reference in New Issue
Block a user