From 8400b466386f978239d932a31ea3c848f5d2f755 Mon Sep 17 00:00:00 2001 From: Luca Invernizzi Date: Sat, 3 Feb 2018 22:30:29 -0800 Subject: [PATCH] Allow to set custom atime and mtime --- js/worker/dev/virtio/9p.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/worker/dev/virtio/9p.js b/js/worker/dev/virtio/9p.js index fc9ae15e..48c9d264 100644 --- a/js/worker/dev/virtio/9p.js +++ b/js/worker/dev/virtio/9p.js @@ -336,12 +336,6 @@ Virtio9p.prototype.ReceiveRequest = function (ringidx, index, GetByte) { if (req[1] & P9_SETATTR_GID) { inode.gid = req[4]; } - if (req[1] & P9_SETATTR_ATIME_SET) { - inode.atime = req[6]; - } - if (req[1] & P9_SETATTR_MTIME_SET) { - inode.atime = req[8]; - } if (req[1] & P9_SETATTR_ATIME) { inode.atime = Math.floor((new Date()).getTime()/1000); } @@ -351,6 +345,12 @@ Virtio9p.prototype.ReceiveRequest = function (ringidx, index, GetByte) { if (req[1] & P9_SETATTR_CTIME) { inode.ctime = Math.floor((new Date()).getTime()/1000); } + if (req[1] & P9_SETATTR_ATIME_SET) { + inode.atime = req[6]; + } + if (req[1] & P9_SETATTR_MTIME_SET) { + inode.mtime = req[8]; + } if (req[1] & P9_SETATTR_SIZE) { this.fs.ChangeSize(this.fids[fid].inodeid, req[5]); }