mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
fix file creation ts for WASI Linux
This commit is contained in:
parent
d7d17bd647
commit
f2001fea50
@ -488,10 +488,10 @@ pub fn get_stat_for_kind(kind: &Kind) -> Option<__wasi_filestat_t> {
|
||||
.as_nanos() as u64,
|
||||
st_ctim: md
|
||||
.created()
|
||||
.ok()?
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
.ok()?
|
||||
.as_nanos() as u64,
|
||||
.ok()
|
||||
.and_then(|ct| ct.duration_since(SystemTime::UNIX_EPOCH).ok())
|
||||
.map(|ct| ct.as_nanos() as u64)
|
||||
.unwrap_or(0),
|
||||
..__wasi_filestat_t::default()
|
||||
})
|
||||
}
|
||||
@ -515,10 +515,10 @@ pub fn get_stat_for_kind(kind: &Kind) -> Option<__wasi_filestat_t> {
|
||||
.as_nanos() as u64,
|
||||
st_ctim: md
|
||||
.created()
|
||||
.ok()?
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
.ok()?
|
||||
.as_nanos() as u64,
|
||||
.ok()
|
||||
.and_then(|ct| ct.duration_since(SystemTime::UNIX_EPOCH).ok())
|
||||
.map(|ct| ct.as_nanos() as u64)
|
||||
.unwrap_or(0),
|
||||
..__wasi_filestat_t::default()
|
||||
})
|
||||
}
|
||||
|
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
is dir: false
|
||||
filetype: false true false
|
||||
file info: 491
|
||||
file info: 456
|
||||
|
@ -13,5 +13,5 @@ fn main() {
|
||||
filetype.is_file(),
|
||||
filetype.is_symlink()
|
||||
);
|
||||
println!("file info: {} {} {}", md.len(), md.modified(), md.created());
|
||||
println!("file info: {}", md.len());
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user