Fix incompatible timespec convertion

This commit is contained in:
xiaoli.zhang 2022-01-12 15:09:31 +08:00 committed by Zongmin.Gu
parent 9675f8a3d0
commit 6353817af8
3 changed files with 5 additions and 5 deletions

2
deps/sefs vendored

@ -1 +1 @@
Subproject commit 522fe55653791084f2dad0d3766b4e48b332b101
Subproject commit d26132ca7b5a3338046e4b644cb75953981f0feb

@ -343,15 +343,15 @@ impl IntoFsMetadata for fs::Metadata {
blocks: self.st_blocks() as usize,
atime: Timespec {
sec: self.st_atime(),
nsec: self.st_atime_nsec() as i32,
nsec: self.st_atime_nsec(),
},
mtime: Timespec {
sec: self.st_mtime(),
nsec: self.st_mtime_nsec() as i32,
nsec: self.st_mtime_nsec(),
},
ctime: Timespec {
sec: self.st_ctime(),
nsec: self.st_ctime_nsec() as i32,
nsec: self.st_ctime_nsec(),
},
type_: match self.st_mode() & 0xf000 {
libc::S_IFCHR => FileType::CharDevice,

@ -248,7 +248,7 @@ impl TimeProvider for OcclumTimeProvider {
let time = do_gettimeofday();
Timespec {
sec: time.sec,
nsec: time.usec as i32 * 1000,
nsec: time.usec * 1000,
}
}
}