From 20feec9facc29dc40787ffaca664c6f594dd19f1 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Wed, 16 Oct 2019 17:13:58 +0200 Subject: [PATCH] pxar: fuse: include nsec information in stat Signed-off-by: Christian Ebner --- src/pxar/fuse.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pxar/fuse.rs b/src/pxar/fuse.rs index 11fa7f7c..ca2fc2c3 100644 --- a/src/pxar/fuse.rs +++ b/src/pxar/fuse.rs @@ -525,7 +525,9 @@ fn stat(inode: u64, entry: &PxarEntry, payload_size: u64) -> Result 2, _ => 1, }; - let time = i64::try_from(entry.mtime).map_err(|_| libc::EIO)? / 1_000_000_000; + let time = i64::try_from(entry.mtime).map_err(|_| libc::EIO)?; + let sec = time / 1_000_000_000; + let nsec = time % 1_000_000_000; let mut attr: libc::stat = unsafe { std::mem::zeroed() }; attr.st_ino = inode; @@ -534,9 +536,12 @@ fn stat(inode: u64, entry: &PxarEntry, payload_size: u64) -> Result