aboutsummaryrefslogtreecommitdiffstats
path: root/example/fusexmp_fh.c
diff options
context:
space:
mode:
Diffstat (limited to 'example/fusexmp_fh.c')
-rw-r--r--example/fusexmp_fh.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c
index 8f8b1a9..96427b3 100644
--- a/example/fusexmp_fh.c
+++ b/example/fusexmp_fh.c
@@ -1,6 +1,7 @@
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
+ Copyright (C) 2011 Sebastian Pipping <sebastian@pipping.org>
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
@@ -23,6 +24,7 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <sys/time.h>
@@ -283,14 +285,8 @@ static int xmp_ftruncate(const char *path, off_t size,
static int xmp_utimens(const char *path, const struct timespec ts[2])
{
int res;
- 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;
-
- res = utimes(path, tv);
+ res = utimensat(0, path, ts, AT_SYMLINK_NOFOLLOW);
if (res == -1)
return -errno;