Lines 1-6
Link Here
|
1 |
--- ./src/unionfs.c.orig 2012-09-11 00:06:32.000000000 +0200 |
1 |
--- src/unionfs.c.orig 2015-01-14 10:08:20 UTC |
2 |
+++ ./src/unionfs.c 2013-07-24 16:54:01.555073796 +0200 |
2 |
+++ src/unionfs.c |
3 |
@@ -83,7 +83,11 @@ |
3 |
@@ -92,7 +92,11 @@ static int unionfs_chmod(const char *pat |
4 |
char p[PATHLEN_MAX]; |
4 |
char p[PATHLEN_MAX]; |
5 |
if (BUILD_PATH(p, uopt.branches[i].path, path)) RETURN(-ENAMETOOLONG); |
5 |
if (BUILD_PATH(p, uopt.branches[i].path, path)) RETURN(-ENAMETOOLONG); |
6 |
|
6 |
|
Lines 12-40
Link Here
|
12 |
if (res == -1) RETURN(-errno); |
12 |
if (res == -1) RETURN(-errno); |
13 |
|
13 |
|
14 |
RETURN(0); |
14 |
RETURN(0); |
15 |
@@ -190,7 +194,7 @@ |
15 |
@@ -287,6 +291,7 @@ static int unionfs_ioctl(const char *pat |
16 |
DBG("%s\n", path); |
16 |
return -EINVAL; |
|
|
17 |
return 0; |
18 |
} |
19 |
+#ifndef __FreeBSD__ |
20 |
case UNIONFS_SET_DEBUG_FILE: { |
21 |
char *debug_path = (char *) data; |
17 |
|
22 |
|
18 |
if (uopt.stats_enabled && strcmp(path, STATS_FILENAME) == 0) { |
23 |
@@ -295,6 +300,7 @@ static int unionfs_ioctl(const char *pat |
19 |
- memset(stbuf, 0, sizeof(stbuf)); |
24 |
debug_init(); |
20 |
+ memset(stbuf, 0, sizeof(*stbuf)); |
25 |
return 0; |
21 |
stbuf->st_mode = S_IFREG | 0444; |
26 |
} |
22 |
stbuf->st_nlink = 1; |
|
|
23 |
stbuf->st_size = STATS_SIZE; |
24 |
@@ -663,7 +667,16 @@ |
25 |
char p[PATHLEN_MAX]; |
26 |
if (BUILD_PATH(p, uopt.branches[i].path, path)) RETURN(-ENAMETOOLONG); |
27 |
|
28 |
+#ifdef __FreeBSD__ |
29 |
+ struct timeval tv[2]; |
30 |
+ tv[0].tv_sec = ts[0].tv_sec; |
31 |
+ tv[0].tv_usec = ts[0].tv_nsec / 1000; |
32 |
+ tv[1].tv_sec = ts[0].tv_sec; |
33 |
+ tv[1].tv_usec = ts[0].tv_nsec / 1000; |
34 |
+ int res = lutimes(p, tv); |
35 |
+#else |
36 |
int res = utimensat(0, p, ts, AT_SYMLINK_NOFOLLOW); |
37 |
+#endif |
27 |
+#endif |
38 |
|
28 |
default: |
39 |
if (res == -1) RETURN(-errno); |
29 |
USYSLOG(LOG_ERR, "Unknown ioctl: %d", cmd); |
40 |
|
30 |
return -EINVAL; |