summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadek Podgorny <radek@podgorny.cz>2014-02-22 17:38:38 +0100
committerRadek Podgorny <radek@podgorny.cz>2014-02-22 17:38:38 +0100
commit088de16eddc048839278cebc53698681cc38425c (patch)
tree2e1e2fe631c88fa4dd0c62ad7c4ac9034194ad8c
parentd3c53337dbe63ac2c4a3580d624ee030a804691b (diff)
downloadunionfs-fuse-088de16eddc048839278cebc53698681cc38425c.tar.gz
utimes fix for Mac OS X
Mac OS X does not support utimensat. (from bernd's tree)
-rw-r--r--src/Makefile2
-rw-r--r--src/unionfs.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index 61d39b5..0ddf6c3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,7 @@
CFLAGS += -Wall
CPPFLAGS += $(shell pkg-config --cflags fuse)
CPPFLAGS += -DFUSE_USE_VERSION=26
-CPPFLAGS += -DHAVE_XATTR
+# CPPFLAGS += -DHAVE_XATTR
LDFLAGS +=
diff --git a/src/unionfs.c b/src/unionfs.c
index 41f4c52..1d92543 100644
--- a/src/unionfs.c
+++ b/src/unionfs.c
@@ -686,6 +686,13 @@ static int unionfs_utimens(const char *path, const struct timespec ts[2]) {
{ts[1].tv_sec, ts[1].tv_nsec / 1000},
};
int res = utimes(p, tv);
+#elif __FreeBSD__
+ struct timeval tv[2];
+ tv[0].tv_sec = ts[0].tv_sec;
+ tv[0].tv_usec = ts[0].tv_nsec * 1000;
+ tv[1].tv_sec = ts[1].tv_sec;
+ tv[1].tv_usec = ts[1].tv_nsec * 1000;
+ int res = utimes(p, tv);
#else
int res = utimensat(0, p, ts, AT_SYMLINK_NOFOLLOW);
#endif