Skip to content

Commit

Permalink
just return 1
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej authored and theduke committed Jun 3, 2024
1 parent 970e245 commit 935c057
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/virtual-fs/src/webc_volume_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use std::{
path::{Path, PathBuf},
pin::Pin,
result::Result,
sync::OnceLock,
task::Poll,
time::UNIX_EPOCH,
};

use futures::future::BoxFuture;
Expand Down Expand Up @@ -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<webc::Timestamps>) -> u64 {
static DEFAULT: OnceLock<u64> = 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 {
Expand Down

0 comments on commit 935c057

Please sign in to comment.