diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-09-02 09:51:08 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2006-09-02 09:51:08 +0000 |
commit | fa44077613d10cf3606d3e3f845585904f6c44a7 (patch) | |
tree | 0f0d28170cfb03b3a20e48ff58b2ecb7c78f8ea7 /example/fusexmp_fh.c | |
parent | 9ae10b743e945487e12e8377b8f9fe49d8a745ab (diff) | |
download | libfuse-fa44077613d10cf3606d3e3f845585904f6c44a7.tar.gz |
fix
Diffstat (limited to 'example/fusexmp_fh.c')
-rw-r--r-- | example/fusexmp_fh.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/example/fusexmp_fh.c b/example/fusexmp_fh.c index c82d061..5ede6db 100644 --- a/example/fusexmp_fh.c +++ b/example/fusexmp_fh.c @@ -17,6 +17,7 @@ #include <fcntl.h> #include <dirent.h> #include <errno.h> +#include <sys/time.h> #ifdef HAVE_SETXATTR #include <sys/xattr.h> #endif @@ -239,11 +240,17 @@ static int xmp_ftruncate(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; @@ -412,7 +419,7 @@ static struct fuse_operations xmp_oper = { .chown = xmp_chown, .truncate = xmp_truncate, .ftruncate = xmp_ftruncate, - .utime = xmp_utime, + .utimes = xmp_utimes, .create = xmp_create, .open = xmp_open, .read = xmp_read, |