From 890728865be296dc05e9321ad8a9054606ee61c4 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Wed, 14 Aug 2024 09:36:56 +0700 Subject: [PATCH] sway_terminate -> ! --- src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0a128a3..23b7c23 100644 --- a/src/main.rs +++ b/src/main.rs @@ -329,7 +329,7 @@ unsafe extern "C" fn swayidle_finish() { free(state.before_sleep_cmd.cast::()); } #[no_mangle] -unsafe extern "C" fn sway_terminate(exit_code: libc::c_int) { +unsafe extern "C" fn sway_terminate(exit_code: libc::c_int) -> ! { wl_display_disconnect(state.display); wl_event_loop_destroy(state.event_loop); swayidle_finish(); @@ -1364,7 +1364,6 @@ unsafe extern "C" fn handle_signal(sig: libc::c_int, _data: *mut libc::c_void) - .cast::(); } sway_terminate(0 as libc::c_int); - return 0 as libc::c_int; } 10 => { log::debug!("Got SIGUSR1"); @@ -1662,7 +1661,6 @@ unsafe fn main_0(argc: libc::c_int, argv: *mut *mut libc::c_char) -> libc::c_int wl_event_source_check(source); while wl_event_loop_dispatch(state.event_loop, -(1 as libc::c_int)) != 1 as libc::c_int {} sway_terminate(0 as libc::c_int); - 0 } fn main() { let mut args: Vec<*mut libc::c_char> = Vec::new();