From 2c7fd02349004d6ee2d76f7a776c07e514bfa343 Mon Sep 17 00:00:00 2001 From: yura Date: Tue, 13 Mar 2007 18:52:02 +0000 Subject: [PATCH] ntfsmount: use utimens() instead of deprecated utime(). --- ChangeLog | 1 + ntfsprogs/ntfsmount.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f527db9b..036efa79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -131,6 +131,7 @@ xx/01/2007 - 2.0.0 - ntfsmount sports full r/w and ntfsresize supports Vista. sensitive and insensitive mounts. (Yura) - ntfsmount: st_block calculation was wrong. (Yuval) - mkntfs: Use Vista $Boot rather than XP one. (Anton) + - ntfsmount: use utimens() instead of deprecated utime(). (Yura) 21/06/2006 - 1.13.1 - Various fixes. diff --git a/ntfsprogs/ntfsmount.c b/ntfsprogs/ntfsmount.c index 8a79a28b..da8346e2 100644 --- a/ntfsprogs/ntfsmount.c +++ b/ntfsprogs/ntfsmount.c @@ -1120,7 +1120,7 @@ static int ntfs_fuse_rmdir(const char *path) return ntfs_fuse_rm(path); } -static int ntfs_fuse_utime(const char *path, struct utimbuf *buf) +static int ntfs_fuse_utimens(const char *path, const struct timespec ts[2]) { ntfs_inode *ni; @@ -1129,10 +1129,10 @@ static int ntfs_fuse_utime(const char *path, struct utimbuf *buf) ni = ntfs_pathname_to_inode(ctx->vol, NULL, path); if (!ni) return -errno; - if (buf) { - ni->last_access_time = buf->actime; - ni->last_data_change_time = buf->modtime; - ni->last_mft_change_time = buf->modtime; + if (ts) { + ni->last_access_time = ts[0].tv_sec; + ni->last_data_change_time = ts[1].tv_sec; + ni->last_mft_change_time = ts[1].tv_sec; } else { time_t now; @@ -1468,7 +1468,7 @@ static struct fuse_operations ntfs_fuse_oper = { .rename = ntfs_fuse_rename, .mkdir = ntfs_fuse_mkdir, .rmdir = ntfs_fuse_rmdir, - .utime = ntfs_fuse_utime, + .utimens = ntfs_fuse_utimens, .destroy = ntfs_fuse_destroy, #ifdef HAVE_SETXATTR .getxattr = ntfs_fuse_getxattr,