From 7d2663e6a2db78da1b0254a52bee941a12945d57 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Sun, 28 May 2017 23:26:57 -0700 Subject: [PATCH] Also initialize Stat to zero in implementation of Resource I didn't notice there were two copies of this code --- mount/redox/resource.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mount/redox/resource.rs b/mount/redox/resource.rs index adcb51cfcb..e406dd564b 100644 --- a/mount/redox/resource.rs +++ b/mount/redox/resource.rs @@ -199,12 +199,15 @@ impl Resource for FileResource { fn stat(&self, stat: &mut Stat, fs: &mut FileSystem) -> Result { let node = fs.node(self.block)?; - stat.st_dev = 0; //TODO - stat.st_ino = node.0; - stat.st_mode = node.1.mode; - stat.st_uid = node.1.uid; - stat.st_gid = node.1.gid; - stat.st_size = fs.node_len(self.block)?; + *stat = Stat { + st_dev: 0, // TODO + st_ino: node.0, + st_mode: node.1.mode, + st_uid: node.1.uid, + st_gid: node.1.gid, + st_size: fs.node_len(self.block)?, + ..Default::default() + }; Ok(0) }