]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
write_disk_posix: rename variable in check_symlinks_fsobj()
authorMartin Matuska <martin@matuska.org>
Sat, 21 Aug 2021 07:07:54 +0000 (09:07 +0200)
committerMartin Matuska <martin@matuska.org>
Sat, 21 Aug 2021 07:13:54 +0000 (09:13 +0200)
Rename the flag "extracting_hardlink" to "checking_linkname" to
be more accurate about its use. If the variable is non-zero it
means that check_symlinks_fsobj() is called on the linkname
when a hardlink is going to be created.

libarchive/archive_write_disk_posix.c

index 83a1f6d16e494173b0d4760733aac4f4f0ecbc31..ba4e65df7a62cd4368933fc418ecb4d137b6c330 100644 (file)
@@ -2680,7 +2680,7 @@ fsobj_error(int *a_eno, struct archive_string *a_estr,
  */
 static int
 check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
-    int flags, int extracting_hardlink)
+    int flags, int checking_linkname)
 {
 #if !defined(HAVE_LSTAT) && \
     !(defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT))
@@ -2689,7 +2689,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
        (void)error_number; /* UNUSED */
        (void)error_string; /* UNUSED */
        (void)flags; /* UNUSED */
-       (void)extracting_hardlink; /* UNUSED */
+       (void)checking_linkname; /* UNUSED */
        return (ARCHIVE_OK);
 #else
        int res = ARCHIVE_OK;
@@ -2811,7 +2811,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
                                head = tail + 1;
                        }
                } else if (S_ISLNK(st.st_mode)) {
-                       if (last && extracting_hardlink) {
+                       if (last && checking_linkname) {
 #ifdef HAVE_LINKAT
                                /*
                                 * Hardlinks to symlinks are safe to write