aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2009-10-21 15:57:07 -0400
committerAvatar Mike Kelly <pioto@pioto.org> 2009-10-21 16:04:18 -0400
commit1b8a81359f1996b489c1a627d07d5d4c63e72b13 (patch)
tree20441f616c7d6385758060ab4fcd12025d3a2f89
parent4eca6177a8e87e907b60c133144354fbfb4fbc29 (diff)
downloadpaludis-1b8a81359f1996b489c1a627d07d5d4c63e72b13.tar.gz
paludis-1b8a81359f1996b489c1a627d07d5d4c63e72b13.tar.xz
Call futimens properly.
-rw-r--r--paludis/merger.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 970fc02..d90b1a8 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -803,10 +803,10 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
if (_imp->params.options()[mo_preserve_mtimes])
{
/* futimens is POSIX, futimes isn't */
- struct timespec ts;
- ts.tv_sec = src.mtime();
- ts.tv_nsec = 0;
- if (0 != ::futimens(output_fd, &ts))
+ struct timespec ts[2];
+ ts[0].tv_sec = ts[1].tv_sec = src.mtime();
+ ts[0].tv_nsec = ts[1].tv_nsec = 0;
+ if (0 != ::futimens(output_fd, ts))
throw MergerError("Cannot futimens '" + stringify(dst) + "': " + stringify(::strerror(errno)));
}