diff options
author | Tim Kientzle <kientzle@FreeBSD.org> | 2004-04-21 05:16:28 +0000 |
---|---|---|
committer | Tim Kientzle <kientzle@FreeBSD.org> | 2004-04-21 05:16:28 +0000 |
commit | fe44171ebdfacf9bd5cc6d5838649401fb2fbe15 (patch) | |
tree | 70fa2900ecc7b16a75135064a8ddd885d308917d /usr.bin | |
parent | 0f7d2bd3803d027ba3297624a7994ad7dba15529 (diff) | |
download | src-fe44171ebdfacf9bd5cc6d5838649401fb2fbe15.tar.gz src-fe44171ebdfacf9bd5cc6d5838649401fb2fbe15.zip |
Eliminate a redundant call to archive_entry_set_pathname()
Notes
Notes:
svn path=/head/; revision=128516
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tar/write.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index 2110bbb4841a..527df2b710ff 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) |