summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-04-21 05:16:28 +0000
committerkientzle <kientzle@FreeBSD.org>2004-04-21 05:16:28 +0000
commit15ca1ccb2d564797fa05583bde39c176bfc04e50 (patch)
tree70fa2900ecc7b16a75135064a8ddd885d308917d /usr.bin/tar
parentbd0115839307ddffc9d78447ec3ac888a653ee2c (diff)
downloadFreeBSD-src-15ca1ccb2d564797fa05583bde39c176bfc04e50.zip
FreeBSD-src-15ca1ccb2d564797fa05583bde39c176bfc04e50.tar.gz
Eliminate a redundant call to archive_entry_set_pathname()
Diffstat (limited to 'usr.bin/tar')
-rw-r--r--usr.bin/tar/write.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c
index 2110bbb..527df2b 100644
--- a/usr.bin/tar/write.c
+++ b/usr.bin/tar/write.c
@@ -677,11 +677,6 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
fd = -1;
entry = archive_entry_new();
- archive_entry_set_pathname(entry, pathname);
-
- /* If there are hard links, record it for later use */
- if (!S_ISDIR(st->st_mode) && (st->st_nlink > 1))
- lookup_hardlink(bsdtar, entry, st);
/* Non-regular files get archived with zero size. */
if (!S_ISREG(st->st_mode))
@@ -698,6 +693,11 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
if (pathname && pathname[0] == '/' && !bsdtar->option_absolute_paths)
pathname++;
+ archive_entry_set_pathname(entry, pathname);
+
+ if (!S_ISDIR(st->st_mode) && (st->st_nlink > 1))
+ lookup_hardlink(bsdtar, entry, st);
+
/* Display entry as we process it. This format is required by SUSv2. */
if (bsdtar->verbose)
safe_fprintf(stderr, "a %s", pathname);
@@ -733,6 +733,7 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
}
#endif
+ archive_entry_copy_stat(entry, st);
setup_acls(bsdtar, entry, accpath);
/*
@@ -752,9 +753,6 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
}
}
- archive_entry_copy_stat(entry, st);
- archive_entry_set_pathname(entry, pathname);
-
e = archive_write_header(a, entry);
if (e != ARCHIVE_OK) {
if (!bsdtar->verbose)
OpenPOWER on IntegriCloud