]> git.lizzy.rs Git - rust.git/commitdiff
std: Fix {atime,mtime,ctime}_nsec accessors
authorAlex Crichton <alex@alexcrichton.com>
Sun, 3 May 2015 19:28:48 +0000 (12:28 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 4 May 2015 18:21:49 +0000 (11:21 -0700)
These all had a typo where they were accessing the seconds field, not the
nanoseconds field.

src/libstd/sys/unix/ext/fs.rs

index 2e4ed38e50fe7c10935e04ffa759f5ef340bcb9d..39910f509f9c28689a80e56d222afb78fc4770ff 100644 (file)
@@ -138,11 +138,11 @@ pub fn gid(&self) -> raw::gid_t { self.0.raw().st_gid as raw::gid_t }
     pub fn rdev(&self) -> raw::dev_t { self.0.raw().st_rdev as raw::dev_t }
     pub fn size(&self) -> raw::off_t { self.0.raw().st_size as raw::off_t }
     pub fn atime(&self) -> raw::time_t { self.0.raw().st_atime }
-    pub fn atime_nsec(&self) -> c_long { self.0.raw().st_atime }
+    pub fn atime_nsec(&self) -> c_long { self.0.raw().st_atime_nsec as c_long }
     pub fn mtime(&self) -> raw::time_t { self.0.raw().st_mtime }
-    pub fn mtime_nsec(&self) -> c_long { self.0.raw().st_mtime }
+    pub fn mtime_nsec(&self) -> c_long { self.0.raw().st_mtime_nsec as c_long }
     pub fn ctime(&self) -> raw::time_t { self.0.raw().st_ctime }
-    pub fn ctime_nsec(&self) -> c_long { self.0.raw().st_ctime }
+    pub fn ctime_nsec(&self) -> c_long { self.0.raw().st_ctime_nsec as c_long }
 
     pub fn blksize(&self) -> raw::blksize_t {
         self.0.raw().st_blksize as raw::blksize_t