diff options
Diffstat (limited to 'paludis/fs_merger.cc')
-rw-r--r-- | paludis/fs_merger.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/paludis/fs_merger.cc b/paludis/fs_merger.cc index 57413f51e..63fb98ade 100644 --- a/paludis/fs_merger.cc +++ b/paludis/fs_merger.cc @@ -390,11 +390,6 @@ FSMerger::install_file(const FSPath & src, const FSPath & dst_dir, const std::st if (0 != ::fchown(output_fd, src_stat.owner(), src_stat.group())) throw FSMergerError("Cannot fchown '" + stringify(dst) + "': " + stringify(::strerror(errno))); - /* set*id bits */ - if (0 != ::fchmod(output_fd, src_perms)) - throw FSMergerError("Cannot fchmod '" + stringify(dst) + "': " + stringify(::strerror(errno))); - try_to_copy_xattrs(src, output_fd, result); - #ifdef HAVE_FALLOCATE if (0 != ::fallocate(output_fd, FALLOC_FL_KEEP_SIZE, 0, src_stat.file_size())) switch (errno) @@ -413,6 +408,11 @@ FSMerger::install_file(const FSPath & src, const FSPath & dst_dir, const std::st } #endif + /* set*id bits, after fallocate because xfs is weird */ + if (0 != ::fchmod(output_fd, src_perms)) + throw FSMergerError("Cannot fchmod '" + stringify(dst) + "': " + stringify(::strerror(errno))); + try_to_copy_xattrs(src, output_fd, result); + char buf[4096]; ssize_t count; while ((count = read(input_fd, buf, 4096)) > 0) |