Lines 1-51
Link Here
|
1 |
--- src/unionfs.c.orig 2015-01-14 10:08:20 UTC |
|
|
2 |
+++ src/unionfs.c |
3 |
@@ -65,6 +65,13 @@ |
4 |
#include "conf.h" |
5 |
#include "uioctl.h" |
6 |
|
7 |
+// Patch pushed upstream: |
8 |
+// https://github.com/rpodgorny/unionfs-fuse/pull/40 |
9 |
+// Remove this as soon as pushed into a release. |
10 |
+#ifdef IOCPARM_LEN |
11 |
+#define _IOC_SIZE(nr) IOCPARM_LEN(nr) |
12 |
+#endif |
13 |
+ |
14 |
static struct fuse_opt unionfs_opts[] = { |
15 |
FUSE_OPT_KEY("chroot=%s,", KEY_CHROOT), |
16 |
FUSE_OPT_KEY("cow", KEY_COW), |
17 |
@@ -92,7 +99,12 @@ static int unionfs_chmod(const char *pat |
18 |
char p[PATHLEN_MAX]; |
19 |
if (BUILD_PATH(p, uopt.branches[i].path, path)) RETURN(-ENAMETOOLONG); |
20 |
|
21 |
+// Unsure of origin. Patch needs review. |
22 |
+#if __FreeBSD__ |
23 |
+ int res = lchmod(p, mode); |
24 |
+#else |
25 |
int res = chmod(p, mode); |
26 |
+#endif |
27 |
if (res == -1) RETURN(-errno); |
28 |
|
29 |
RETURN(0); |
30 |
@@ -671,6 +683,9 @@ static int unionfs_truncate(const char * |
31 |
RETURN(0); |
32 |
} |
33 |
|
34 |
+// Patch pushed upstream: |
35 |
+// https://github.com/rpodgorny/unionfs-fuse/pull/39 |
36 |
+// Remove this as soon as pushed into a release. |
37 |
static int unionfs_utimens(const char *path, const struct timespec ts[2]) { |
38 |
DBG("%s\n", path); |
39 |
|
40 |
@@ -685,9 +700,9 @@ static int unionfs_utimens(const char *p |
41 |
#else |
42 |
struct timeval tv[2]; |
43 |
tv[0].tv_sec = ts[0].tv_sec; |
44 |
- tv[0].tv_usec = ts[0].tv_nsec * 1000; |
45 |
+ tv[0].tv_usec = ts[0].tv_nsec / 1000; |
46 |
tv[1].tv_sec = ts[1].tv_sec; |
47 |
- tv[1].tv_usec = ts[1].tv_nsec * 1000; |
48 |
+ tv[1].tv_usec = ts[1].tv_nsec / 1000; |
49 |
int res = utimes(p, tv); |
50 |
#endif |
51 |
|