aboutsummaryrefslogtreecommitdiffstats
path: root/example/fusexmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/fusexmp.c')
-rw-r--r--example/fusexmp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/example/fusexmp.c b/example/fusexmp.c
index a30c9fd..5f54667 100644
--- a/example/fusexmp.c
+++ b/example/fusexmp.c
@@ -20,6 +20,7 @@
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
+#include <sys/time.h>
#ifdef HAVE_SETXATTR
#include <sys/xattr.h>
#endif
@@ -204,18 +205,23 @@ static int xmp_truncate(const char *path, off_t size)
return 0;
}
-static int xmp_utime(const char *path, struct utimbuf *buf)
+static int xmp_utimes(const char *path, const struct timespec ts[2])
{
int res;
+ struct timeval tv[2];
- res = utime(path, buf);
+ 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;
+
+ res = utimes(path, tv);
if (res == -1)
return -errno;
return 0;
}
-
static int xmp_open(const char *path, struct fuse_file_info *fi)
{
int res;
@@ -351,7 +357,7 @@ static struct fuse_operations xmp_oper = {
.chmod = xmp_chmod,
.chown = xmp_chown,
.truncate = xmp_truncate,
- .utime = xmp_utime,
+ .utimes = xmp_utimes,
.open = xmp_open,
.read = xmp_read,
.write = xmp_write,