diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-16 08:46:58 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-16 08:46:58 +0400 |
| commit | b3d2096439f194108bd11c56fbf0ecb1a7a73fdf (patch) | |
| tree | 859cde57499df8e308b89887f7a84ab252b905a6 /src | |
| parent | 94ded2f6a9c6724fd6d90f0de4d9e8488880ecc9 (diff) | |
| download | niri-b3d2096439f194108bd11c56fbf0ecb1a7a73fdf.tar.gz niri-b3d2096439f194108bd11c56fbf0ecb1a7a73fdf.tar.bz2 niri-b3d2096439f194108bd11c56fbf0ecb1a7a73fdf.zip | |
Replace set_modified() with manual impl
MSRV moment
Diffstat (limited to 'src')
| -rw-r--r-- | src/watcher.rs | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/watcher.rs b/src/watcher.rs index e5b9458a..84fdab5c 100644 --- a/src/watcher.rs +++ b/src/watcher.rs @@ -91,10 +91,11 @@ mod tests { use std::fs::File; use std::io::Write; use std::sync::atomic::AtomicU8; - use std::time::SystemTime; use calloop::channel::sync_channel; use calloop::EventLoop; + use smithay::reexports::rustix::fs::{futimens, Timestamps}; + use smithay::reexports::rustix::time::Timespec; use xshell::{cmd, Shell}; use super::*; @@ -280,7 +281,19 @@ mod tests { let mut c2 = File::create(d2).unwrap(); write!(c2, "a")?; c2.flush()?; - c2.set_modified(SystemTime::UNIX_EPOCH)?; + futimens( + &c2, + &Timestamps { + last_access: Timespec { + tv_sec: 0, + tv_nsec: 0, + }, + last_modification: Timespec { + tv_sec: 0, + tv_nsec: 0, + }, + }, + )?; c2.sync_all()?; drop(c2); @@ -289,7 +302,19 @@ mod tests { let mut c3 = File::create(d3).unwrap(); write!(c3, "b")?; c3.flush()?; - c3.set_modified(SystemTime::UNIX_EPOCH)?; + futimens( + &c3, + &Timestamps { + last_access: Timespec { + tv_sec: 0, + tv_nsec: 0, + }, + last_modification: Timespec { + tv_sec: 0, + tv_nsec: 0, + }, + }, + )?; c3.sync_all()?; drop(c3); |
