Collapse some signal checking behind Unix conditional compilation
@@ -829,20 +829,11 @@ impl Manager {
if self.check_for_departure() {
break ShutdownMode::Departed;
}
- if !self.feature_flags.contains(FeatureFlag::IGNORE_SIGNALS) {
- // Normally, we'd use an `if let Some(...)`
- // formulation here, but we can't add `#cfg[...]`
- // annotations to `if` expressions right now.
- //
- // We *can* add them to match arms, though!
- match signals::check_for_signal() {
- #[cfg(unix)] // Passthrough SignalEvents aren't a thing on Windows
- Some(SignalEvent::Passthrough(Signal::HUP)) => {
+ if !self.feature_flags.contains(FeatureFlag::IGNORE_SIGNALS) && cfg!(unix) {
+ if let Some(SignalEvent::Passthrough(Signal::HUP)) = signals::check_for_signal() {
outputln!("Supervisor shutting down for signal");
break ShutdownMode::Restarting;
}
- _ => {}
- }
}
if let Some(package) = self.check_for_updated_supervisor() {
