commit bc0d5a35a84e6df3dbebad5718075d873e57e3f3
parent 1cea37ea8ae9583af3220ae6de8e907cf2a09a4d
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Sat, 11 Jun 2016 16:48:57 -0600
src: struct stat is different on __APPLE__
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/inst_main.cc b/src/inst_main.cc
@@ -116,8 +116,13 @@ copy_file(std::string dst_fn, std::string src_fn)
struct timeval st_tim[2];
stat(src_fn.c_str(), &sb);
+#ifdef __APPLE__
+ TIMESPEC_TO_TIMEVAL(&st_tim[0], &sb.st_atimespec);
+ TIMESPEC_TO_TIMEVAL(&st_tim[1], &sb.st_mtimespec);
+#else
TIMESPEC_TO_TIMEVAL(&st_tim[0], &sb.st_atim);
TIMESPEC_TO_TIMEVAL(&st_tim[1], &sb.st_mtim);
+#endif
std::ifstream src(src_fn, std::ios::binary);
std::ofstream dst(dst_fn, std::ios::binary);