From 935c05770fbaf4ca241d90ac1bd279403f50b5dd Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Mon, 3 Jun 2024 13:17:52 +0330 Subject: [PATCH] just return 1 --- lib/virtual-fs/src/webc_volume_fs.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/virtual-fs/src/webc_volume_fs.rs b/lib/virtual-fs/src/webc_volume_fs.rs index fc4f139fd03..7ce0638590e 100644 --- a/lib/virtual-fs/src/webc_volume_fs.rs +++ b/lib/virtual-fs/src/webc_volume_fs.rs @@ -4,9 +4,7 @@ use std::{ path::{Path, PathBuf}, pin::Pin, result::Result, - sync::OnceLock, task::Poll, - time::UNIX_EPOCH, }; use futures::future::BoxFuture; @@ -298,11 +296,7 @@ impl AsyncWrite for File { // proved to cause problems with programs that interpret the value 0. // to circumvent this problem, we decided to return a non-zero value. fn get_modified(timestamps: Option) -> u64 { - static DEFAULT: OnceLock = OnceLock::new(); - - timestamps - .map(|t| t.modified()) - .unwrap_or(*DEFAULT.get_or_init(|| UNIX_EPOCH.elapsed().unwrap().as_secs())) + timestamps.map(|t| t.modified()).unwrap_or(1) } fn compat_meta(meta: webc::compat::Metadata) -> Metadata {