|
diff --git a/src/Makefile b/src/Makefile |
|
index 82f7a1c..dfcbc95 100644 |
|
--- a/src/Makefile |
|
+++ b/src/Makefile |
|
@@ -1,11 +1,15 @@ |
|
-CFLAGS += -Wall |
|
-CPPFLAGS += $(shell pkg-config --cflags fuse) |
|
+CFLAGS += -Wall -mmacosx-version-min=10.6 $(ARCH) |
|
+#CPPFLAGS += $(shell pkg-config --cflags fuse) |
|
+CPPFLAGS += -I/usr/local/include/osxfuse |
|
CPPFLAGS += -DFUSE_USE_VERSION=26 |
|
-CPPFLAGS += -DHAVE_XATTR |
|
+#CPPFLAGS += -DHAVE_XATTR |
|
+#CPPFLAGS += -DHAVE_MALLOC_H |
|
+CPPFLAGS += -D_FILE_OFFSET_BITS=64 |
|
|
|
-LDFLAGS += |
|
+LDFLAGS += -mmacosx-version-min=10.6 $(ARCH) |
|
|
|
-LIB = $(shell pkg-config --libs fuse) |
|
+#LIB = $(shell pkg-config --libs fuse) |
|
+LIB = -L/usr/local/lib $(OSXFUSE_ARCH_LIB) |
|
|
|
HASHTABLE_OBJ = hashtable.o hashtable_itr.o |
|
UNIONFS_OBJ = unionfs.o stats.o opts.o debug.o findbranch.o readdir.o \ |
|
diff --git a/src/unionfs.c b/src/unionfs.c |
|
index 186cd53..c1b79fd 100644 |
|
--- a/src/unionfs.c |
|
+++ b/src/unionfs.c |
|
@@ -190,7 +190,7 @@ static int unionfs_getattr(const char *path, struct stat *stbuf) { |
|
DBG("%s\n", path); |
|
|
|
if (uopt.stats_enabled && strcmp(path, STATS_FILENAME) == 0) { |
|
- memset(stbuf, 0, sizeof(stbuf)); |
|
+ memset(stbuf, 0, sizeof(*stbuf)); |
|
stbuf->st_mode = S_IFREG | 0444; |
|
stbuf->st_nlink = 1; |
|
stbuf->st_size = STATS_SIZE; |
|
@@ -663,7 +663,27 @@ static int unionfs_utimens(const char *path, const struct timespec ts[2]) { |
|
char p[PATHLEN_MAX]; |
|
if (BUILD_PATH(p, uopt.branches[i].path, path)) RETURN(-ENAMETOOLONG); |
|
|
|
- int res = utimensat(0, p, ts, AT_SYMLINK_NOFOLLOW); |
|
+ |
|
+ int res; |
|
+#ifdef HAVE_UTIMENSAT |
|
+ res = utimensat(0, p, ts, AT_SYMLINK_NOFOLLOW); |
|
+#else |
|
+ struct timeval tv_copy[2]; |
|
+ struct timeval *tv; |
|
+ if (ts != NULL) |
|
+ { |
|
+ tv_copy[0].tv_sec = ts[0].tv_sec; |
|
+ tv_copy[0].tv_usec = ts[0].tv_nsec / 1000; |
|
+ tv_copy[1].tv_sec = ts[1].tv_sec; |
|
+ tv_copy[1].tv_usec = ts[1].tv_nsec / 1000; |
|
+ tv = tv_copy; |
|
+ } |
|
+ else |
|
+ { |
|
+ tv = NULL; |
|
+ } |
|
+ res = utimes(p, tv); |
|
+#endif |
|
|
|
if (res == -1) RETURN(-errno); |
|
|
|
diff --git a/src/usyslog.c b/src/usyslog.c |
|
index 75becac..0c8a8ed 100644 |
|
--- a/src/usyslog.c |
|
+++ b/src/usyslog.c |
|
@@ -20,7 +20,9 @@ |
|
#include <string.h> |
|
#include <stdlib.h> |
|
#include <errno.h> |
|
+#ifdef HAVE_MALLOC_H |
|
#include <malloc.h> |
|
+#endif |
|
#include <pthread.h> |
|
#include <stdarg.h> |
|
|