diff --git a/tst/passthrough-fuse/passthrough-fuse.c b/tst/passthrough-fuse/passthrough-fuse.c index 7128c0ac..131e0613 100644 --- a/tst/passthrough-fuse/passthrough-fuse.c +++ b/tst/passthrough-fuse/passthrough-fuse.c @@ -41,8 +41,8 @@ #define fi_fh(fi, MASK) ((fi)->fh & (MASK)) #define fi_setfh(fi, FH, MASK) ((fi)->fh = (intptr_t)(FH) | (MASK)) #define fi_fd(fi) (fi_fh(fi, fi_dirbit) ? \ - dirfd((DIR *)fi_fh(fi, ~fi_dirbit)) : (int)fi_fh(fi, ~fi_dirbit)) -#define fi_dirp(fi) ((DIR *)fi_fh(fi, ~fi_dirbit)) + dirfd((DIR *)(intptr_t)fi_fh(fi, ~fi_dirbit)) : (int)fi_fh(fi, ~fi_dirbit)) +#define fi_dirp(fi) ((DIR *)(intptr_t)fi_fh(fi, ~fi_dirbit)) #define fi_setfd(fi, fd) (fi_setfh(fi, fd, 0)) #define fi_setdirp(fi, dirp) (fi_setfh(fi, dirp, fi_dirbit)) @@ -255,7 +255,7 @@ static int ptfs_utimens(const char *path, const struct fuse_timespec tv[2]) { ptfs_impl_fullpath(path); - return -1 != utimensat(AT_FDCWD, path, tv) ? 0 : -errno; + return -1 != utimensat(AT_FDCWD, path, tv, AT_SYMLINK_NOFOLLOW) ? 0 : -errno; } #endif diff --git a/tst/passthrough-fuse/winposix.c b/tst/passthrough-fuse/winposix.c index 0531e32a..3c61b07d 100644 --- a/tst/passthrough-fuse/winposix.c +++ b/tst/passthrough-fuse/winposix.c @@ -334,7 +334,7 @@ int truncate(const char *path, fuse_off_t size) int utime(const char *path, const struct fuse_utimbuf *timbuf) { if (0 == timbuf) - return utimensat(AT_FDCWD, path, 0); + return utimensat(AT_FDCWD, path, 0, AT_SYMLINK_NOFOLLOW); else { struct fuse_timespec times[2]; @@ -342,13 +342,14 @@ int utime(const char *path, const struct fuse_utimbuf *timbuf) times[0].tv_nsec = 0; times[1].tv_sec = timbuf->modtime; times[1].tv_nsec = 0; - return utimensat(AT_FDCWD, path, times); + return utimensat(AT_FDCWD, path, times, AT_SYMLINK_NOFOLLOW); } } -int utimensat(int dirfd, const char *path, const struct fuse_timespec times[2]) +int utimensat(int dirfd, const char *path, const struct fuse_timespec times[2], int flag) { /* ignore dirfd and assume that it is always AT_FDCWD */ + /* ignore flag and assume that it is always AT_SYMLINK_NOFOLLOW */ HANDLE h = CreateFileA(path, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, diff --git a/tst/passthrough-fuse/winposix.h b/tst/passthrough-fuse/winposix.h index ded928c4..6fd934c8 100644 --- a/tst/passthrough-fuse/winposix.h +++ b/tst/passthrough-fuse/winposix.h @@ -28,6 +28,7 @@ #define PATH_MAX 1024 #define AT_FDCWD -2 +#define AT_SYMLINK_NOFOLLOW 2 typedef struct _DIR DIR; struct dirent @@ -54,7 +55,7 @@ int lchown(const char *path, fuse_uid_t uid, fuse_gid_t gid); int lchflags(const char *path, uint32_t flags); int truncate(const char *path, fuse_off_t size); int utime(const char *path, const struct fuse_utimbuf *timbuf); -int utimensat(int dirfd, const char *path, const struct fuse_timespec times[2]); +int utimensat(int dirfd, const char *path, const struct fuse_timespec times[2], int flag); int setcrtime(const char *path, const struct fuse_timespec *tv); int unlink(const char *path); int rename(const char *oldpath, const char *newpath);