From 708ca7b1d6dfe56f3c07956163b1ee0181a3977e Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Wed, 12 Nov 2014 21:55:34 +0100 Subject: [PATCH] utimens --- src/CryFuse.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/CryFuse.cpp b/src/CryFuse.cpp index 3cb8e2f3..706e8745 100644 --- a/src/CryFuse.cpp +++ b/src/CryFuse.cpp @@ -180,17 +180,13 @@ int CryFuse::ftruncate(const path &path, off_t size, fuse_file_info *fileinfo) { //TODO int CryFuse::utimens(const path &path, const timespec times[2]) { - UNUSED(times); - printf("NOT IMPLEMENTED: utimens(%s, _)\n", path.c_str()); - //auto real_path = _device->RootDir() / path; - //struct timeval tv[2]; - //tv[0].tv_sec = times[0].tv_sec; - //tv[0].tv_usec = times[0].tv_nsec / 1000; - //tv[1].tv_sec = times[1].tv_sec; - //tv[1].tv_usec = times[1].tv_nsec / 1000; - //int retstat = ::lutimes(real_path.c_str(), tv); - //return errcode_map(retstat); - return 0; + //printf("utimens(%s, _)\n", path.c_str()); + try { + _device->utimens(path, times); + return 0; + } catch (CryErrnoException &e) { + return -e.getErrno(); + } } int CryFuse::open(const path &path, fuse_file_info *fileinfo) {