From 74d1c11fbe30fa174e4454e4f9086c26b4341aae Mon Sep 17 00:00:00 2001 From: Marcin Mielniczuk Date: Mon, 12 Aug 2019 09:24:45 +0200 Subject: [PATCH] Fix fd_filestat_set_times and enable the fd_filestat_set test on Windows. --- build.rs | 1 - src/hostcalls_impl/fs.rs | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index e0b7ef6844..dda957c59f 100644 --- a/build.rs +++ b/build.rs @@ -136,7 +136,6 @@ cfg_if::cfg_if! { "symlink_loop" => true, "clock_time_get" => true, "truncation_rights" => true, - "fd_filestat_set" => true, _ => false, } } else { diff --git a/src/hostcalls_impl/fs.rs b/src/hostcalls_impl/fs.rs index bdc622c456..4f9f83c066 100644 --- a/src/hostcalls_impl/fs.rs +++ b/src/hostcalls_impl/fs.rs @@ -766,10 +766,10 @@ pub(crate) fn fd_filestat_set_times( let st_mtim = dec_timestamp(st_mtim); let fst_flags = dec_fstflags(fst_flags); - let set_atim = fst_flags & host::__WASI_FILESTAT_SET_MTIM != 0; - let set_atim_now = fst_flags & host::__WASI_FILESTAT_SET_MTIM != 0; + let set_atim = fst_flags & host::__WASI_FILESTAT_SET_ATIM != 0; + let set_atim_now = fst_flags & host::__WASI_FILESTAT_SET_ATIM_NOW != 0; let set_mtim = fst_flags & host::__WASI_FILESTAT_SET_MTIM != 0; - let set_mtim_now = fst_flags & host::__WASI_FILESTAT_SET_MTIM != 0; + let set_mtim_now = fst_flags & host::__WASI_FILESTAT_SET_MTIM_NOW != 0; if (set_atim && set_atim_now) || (set_mtim && set_mtim_now) { return Err(host::__WASI_EINVAL);