diff options
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/archive_read_extract.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c index 9e851bb..cde42b8 100644 --- a/lib/libarchive/archive_read_extract.c +++ b/lib/libarchive/archive_read_extract.c @@ -1054,10 +1054,13 @@ set_perm(struct archive *a, int fd, struct archive_entry *entry, */ if (!S_ISLNK(archive_entry_mode(entry))) { #ifdef HAVE_FCHMOD - if (fd >= 0 && fchmod(fd, mode) != 0) { - archive_set_error(a, errno, "Can't set permissions"); - return (ARCHIVE_WARN); - } + if (fd >= 0) { + if (fchmod(fd, mode) != 0) { + archive_set_error(a, errno, + "Can't set permissions"); + return (ARCHIVE_WARN); + } + } else #endif if (chmod(name, mode) != 0) { archive_set_error(a, errno, "Can't set permissions"); |