From 62cdab99c71fbb44c034f4869306e127cf0def5b Mon Sep 17 00:00:00 2001 From: Laurence Tratt Date: Thu, 24 Sep 2026 13:06:48 +0100 Subject: [PATCH] Don't swallow repeated `SIGHUP`s. The chances of someone encountering an actual problem here are miniscule, but since the fix reduces the code size, it's worth doing! --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7b24464..43a4354 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,12 +83,11 @@ impl Snare { /// the snare.conf file specified when we started. **Note that another thread may have called /// this function and caused the config to have changed.** fn check_for_sighup(&self) { - if self.sighup_occurred.load(Ordering::Relaxed) { + if self.sighup_occurred.swap(false, Ordering::Relaxed) { match Config::from_path(&self.conf_path) { Ok(conf) => *self.conf.lock().unwrap() = conf, Err(msg) => self.error(&msg), } - self.sighup_occurred.store(false, Ordering::Relaxed); } }