chore: linting

This commit is contained in:
zhom
2026-02-22 03:35:29 +04:00
parent ddc2657165
commit 2e193987df
2 changed files with 11 additions and 5 deletions
+2
View File
@@ -141,6 +141,7 @@
"pathex",
"pathlib",
"peerconnection",
"PHANDLER",
"pids",
"pixbuf",
"pkexec",
@@ -181,6 +182,7 @@
"shadcn",
"showcursor",
"shutil",
"sighandler",
"signon",
"signum",
"sklearn",
+9 -5
View File
@@ -179,8 +179,14 @@ fn run_daemon() {
extern "C" fn signal_handler(_sig: libc::c_int) {
SHOULD_QUIT.store(true, std::sync::atomic::Ordering::SeqCst);
}
libc::signal(libc::SIGTERM, signal_handler as libc::sighandler_t);
libc::signal(libc::SIGINT, signal_handler as libc::sighandler_t);
libc::signal(
libc::SIGTERM,
signal_handler as *const () as libc::sighandler_t,
);
libc::signal(
libc::SIGINT,
signal_handler as *const () as libc::sighandler_t,
);
}
#[cfg(windows)]
@@ -292,7 +298,6 @@ fn run_daemon() {
}
fn stop_daemon() {
let state_path = get_state_path();
let state = read_state();
if let Some(pid) = state.daemon_pid {
@@ -301,7 +306,7 @@ fn stop_daemon() {
{
use std::process::Command;
// Read gui_pid from state file and kill it first
let state_path = get_state_path();
if let Ok(content) = fs::read_to_string(&state_path) {
if let Ok(val) = serde_json::from_str::<serde_json::Value>(&content) {
if let Some(gui_pid) = val.get("gui_pid").and_then(|v| v.as_u64()) {
@@ -320,7 +325,6 @@ fn stop_daemon() {
#[cfg(unix)]
{
let _ = &state_path; // suppress unused warning on unix
unsafe {
libc::kill(pid as i32, libc::SIGTERM);
}