forge
Explore
Log in

Don't you dare go Hollow

Replace set_modified() with manual impl

Browse files at this commit

b3d2096439f194108bd11c56fbf0ecb1a7a73fdfIvan MolodetskikhParent: 94ded2f
MSRV moment
src/watcher.rsmodified+28 -3
@@ -91,10 +91,11 @@ mod tests {
9191 use std::fs::File;
9292 use std::io::Write;
9393 use std::sync::atomic::AtomicU8;
94- use std::time::SystemTime;
9594
9695 use calloop::channel::sync_channel;
9796 use calloop::EventLoop;
97+ use smithay::reexports::rustix::fs::{futimens, Timestamps};
98+ use smithay::reexports::rustix::time::Timespec;
9899 use xshell::{cmd, Shell};
99100
100101 use super::*;
@@ -280,7 +281,19 @@ mod tests {
280281 let mut c2 = File::create(d2).unwrap();
281282 write!(c2, "a")?;
282283 c2.flush()?;
283- c2.set_modified(SystemTime::UNIX_EPOCH)?;
284+ futimens(
285+ &c2,
286+ &Timestamps {
287+ last_access: Timespec {
288+ tv_sec: 0,
289+ tv_nsec: 0,
290+ },
291+ last_modification: Timespec {
292+ tv_sec: 0,
293+ tv_nsec: 0,
294+ },
295+ },
296+ )?;
284297 c2.sync_all()?;
285298 drop(c2);
286299
@@ -289,7 +302,19 @@ mod tests {
289302 let mut c3 = File::create(d3).unwrap();
290303 write!(c3, "b")?;
291304 c3.flush()?;
292- c3.set_modified(SystemTime::UNIX_EPOCH)?;
305+ futimens(
306+ &c3,
307+ &Timestamps {
308+ last_access: Timespec {
309+ tv_sec: 0,
310+ tv_nsec: 0,
311+ },
312+ last_modification: Timespec {
313+ tv_sec: 0,
314+ tv_nsec: 0,
315+ },
316+ },
317+ )?;
293318 c3.sync_all()?;
294319 drop(c3);
295320