From 0103bcdb602568f62df2005fd89cadd32826beaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Tue, 29 Jun 2010 11:34:14 +0200 Subject: [PATCH] Fixed use of utimensat() with external fuse older than 2.8 --- src/lowntfs-3g.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index bebe0b79..a9c94a91 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -1581,7 +1581,7 @@ exit: return res; } -#ifdef HAVE_UTIMENSAT +#if defined(HAVE_UTIMENSAT) & defined(FUSE_SET_ATTR_ATIME_NOW) static int ntfs_fuse_utimens(struct SECURITY_CONTEXT *scx, fuse_ino_t ino, struct stat *stin, struct stat *stbuf, int to_set) @@ -1628,7 +1628,7 @@ static int ntfs_fuse_utimens(struct SECURITY_CONTEXT *scx, fuse_ino_t ino, return res; } -#else /* HAVE_UTIMENSAT */ +#else /* defined(HAVE_UTIMENSAT) & defined(FUSE_SET_ATTR_ATIME_NOW) */ static int ntfs_fuse_utime(struct SECURITY_CONTEXT *scx, fuse_ino_t ino, struct stat *stin, struct stat *stbuf) @@ -1699,7 +1699,7 @@ static int ntfs_fuse_utime(struct SECURITY_CONTEXT *scx, fuse_ino_t ino, return res; } -#endif /* HAVE_UTIMENSAT */ +#endif /* defined(HAVE_UTIMENSAT) & defined(FUSE_SET_ATTR_ATIME_NOW) */ static void ntfs_fuse_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, int to_set, struct fuse_file_info *fi __attribute__((unused))) @@ -1774,11 +1774,11 @@ static void ntfs_fuse_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, } /* some set of atime/mtime */ if (!res && (to_set & (FUSE_SET_ATTR_ATIME + FUSE_SET_ATTR_MTIME))) { -#ifdef HAVE_UTIMENSAT +#if defined(HAVE_UTIMENSAT) & defined(FUSE_SET_ATTR_ATIME_NOW) res = ntfs_fuse_utimens(&security, ino, attr, &stbuf, to_set); -#else /* HAVE_UTIMENSAT */ +#else /* defined(HAVE_UTIMENSAT) & defined(FUSE_SET_ATTR_ATIME_NOW) */ res = ntfs_fuse_utime(&security, ino, attr, &stbuf); -#endif /* HAVE_UTIMENSAT */ +#endif /* defined(HAVE_UTIMENSAT) & defined(FUSE_SET_ATTR_ATIME_NOW) */ } if (res) fuse_reply_err(req, -res);