X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fnames.c;h=ba4d509e47ead3bfd99846250f05c623878a11c8;hb=49bd102a1b220a0e4ad3e0e75ac0cdd2a5964efa;hp=c38ccb6ca2a25f18d65d219deaadcb194da3b178;hpb=8da503cad6e883b30c05749149084d24319063b4;p=chaz%2Ftar diff --git a/src/names.c b/src/names.c index c38ccb6..ba4d509 100644 --- a/src/names.c +++ b/src/names.c @@ -47,8 +47,6 @@ static char *cached_no_such_gname; static uid_t cached_no_such_uid; static gid_t cached_no_such_gid; -static void register_individual_file (char const *name); - /* Given UID, find the corresponding UNAME. */ void uid_to_uname (uid_t uid, char **uname) @@ -360,8 +358,6 @@ name_next_elt (int change_dirs) { if (unquote_option) unquote_string (name_buffer); - if (incremental_option) - register_individual_file (name_buffer); entry.type = ep->type; entry.v.name = name_buffer; return &entry; @@ -981,14 +977,15 @@ collect_and_sort_names (void) tar_stat_init (&st); - if (deref_stat (dereference_option, name->name, &st.stat) != 0) + if (deref_stat (name->name, &st.stat) != 0) { stat_diag (name->name); continue; } if (S_ISDIR (st.stat.st_mode)) { - int dir_fd = open (name->name, open_read_flags | O_DIRECTORY); + int dir_fd = openat (chdir_fd, name->name, + open_read_flags | O_DIRECTORY); if (dir_fd < 0) open_diag (name->name); else @@ -1150,28 +1147,6 @@ excluded_name (char const *name) { return excluded_file_name (excluded, name + FILE_SYSTEM_PREFIX_LEN (name)); } - -static Hash_table *individual_file_table; - -static void -register_individual_file (char const *name) -{ - struct stat st; - - if (deref_stat (dereference_option, name, &st) != 0) - return; /* Will be complained about later */ - if (S_ISDIR (st.st_mode)) - return; - - hash_string_insert (&individual_file_table, name); -} - -bool -is_individual_file (char const *name) -{ - return hash_string_lookup (individual_file_table, name); -} - /* Return the size of the prefix of FILE_NAME that is removed after