fix utimes() st_ctime if struct utimbuf buf wasn't NULL (Carmelo Viavattene, Szaka)

master
szaka 2007-10-31 21:30:47 +00:00
parent 3e602f753e
commit 028f73740d
1 changed files with 4 additions and 5 deletions

View File

@ -1188,6 +1188,7 @@ static int ntfs_fuse_rmdir(const char *path)
static int ntfs_fuse_utime(const char *path, struct utimbuf *buf)
{
ntfs_inode *ni;
time_t now;
int res = 0;
if (ntfs_fuse_is_named_data_stream(path))
@ -1198,17 +1199,15 @@ static int ntfs_fuse_utime(const char *path, struct utimbuf *buf)
NInoSetNoParentMtimeUpdate(ni);
now = time(NULL);
ni->last_mft_change_time = now;
if (buf) {
ni->last_access_time = buf->actime;
ni->last_data_change_time = buf->modtime;
ni->last_mft_change_time = buf->modtime;
} else {
time_t now;
now = time(NULL);
ni->last_access_time = now;
ni->last_data_change_time = now;
ni->last_mft_change_time = now;
}
NInoFileNameSetDirty(ni);
NInoSetDirty(ni);