From ecbd78132117cf559f9812288cfa924f973b584a Mon Sep 17 00:00:00 2001 From: Artur Meski Date: Fri, 8 May 2026 19:15:35 +0100 Subject: [PATCH] Fixed skipping of interfaces that don't have IPv6 in -6 mode --- .gitignore | 1 + src/main.rs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/src/main.rs b/src/main.rs index 919844b..458ecf4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -95,11 +95,13 @@ impl Monitor { /// Was the file modified since the last check? fn check_file_modified(&mut self, lease_file_path: &str) -> bool { - let metadata = fs::metadata(&lease_file_path); + let metadata = match fs::metadata(&lease_file_path) { + Ok(m) => m, + Err(_) => return false, + }; let current_timestamp = metadata - .expect("Unsupported platform") .modified() - .expect("Error getting modification timestamp"); + .expect("Unsupported platform: cannot read file mtime"); let last_timestamp = self .timestamps