intercept_sigs: fix typos & bad rustfmt

This commit is contained in:
hosted-fornet 2023-12-21 16:21:09 -08:00
parent 800d8bc8f0
commit 45c552962e

View File

@ -2,22 +2,22 @@ use tokio::signal::unix::{signal, SignalKind};
/// trigger cleanup if receive signal to kill process
pub async fn intercept_sigs() -> String {
let mut sigalrm =
signal(SignalKind::alarm()).expect("uqdev run-tests: failed to set up SIGALRM handler");
let mut sighup =
signal(SignalKind::hangup()).expect("uqdev run-tests: failed to set up SIGHUP handler");
let mut sigint =
signal(SignalKind::interrupt()).expect("uqdev run-tests: failed to set up SIGINT handler");
let mut sigpipe =
signal(SignalKind::pipe()).expect("uqdev run-tests: failed to set up SIGPIPE handler");
let mut sigquit =
signal(SignalKind::quit()).expect("uqdev run-tests: failed to set up SIGQUIT handler");
let mut sigterm =
signal(SignalKind::terminate()).expect("uqdev run-tests: failed to set up SIGTERM handler");
let mut sigalrm = signal(SignalKind::alarm())
.expect("uqbar: failed to set up SIGALRM handler");
let mut sighup = signal(SignalKind::hangup())
.expect("uqbar: failed to set up SIGHUP handler");
let mut sigint = signal(SignalKind::interrupt())
.expect("uqbar: failed to set up SIGINT handler");
let mut sigpipe = signal(SignalKind::pipe())
.expect("uqbar: failed to set up SIGPIPE handler");
let mut sigquit = signal(SignalKind::quit())
.expect("uqbar: failed to set up SIGQUIT handler");
let mut sigterm = signal(SignalKind::terminate())
.expect("uqbar: failed to set up SIGTERM handler");
let mut sigusr1 = signal(SignalKind::user_defined1())
.expect("uqdev run-tests: failed to set up SIGUSR1 handler");
.expect("uqbar: failed to set up SIGUSR1 handler");
let mut sigusr2 = signal(SignalKind::user_defined2())
.expect("uqdev run-tests: failed to set up SIGUSR2 handler");
.expect("uqbar: failed to set up SIGUSR2 handler");
tokio::select! {
_ = sigalrm.recv() => "exiting due to SIGALRM",