1
0
Fork 0

Do not run slstatus

This commit is contained in:
Alex Kotov 2021-11-19 13:52:24 +05:00
parent f3983a9f96
commit 80379d69d6
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 0 additions and 18 deletions

View File

@ -1,5 +1,4 @@
use std::ffi::CString;
use std::thread;
fn main() {
unsafe { unsafe_main() }
@ -23,25 +22,8 @@ unsafe fn unsafe_main() {
libc::exit(libc::EXIT_FAILURE);
}
let status_thread = thread::spawn(move || {
let pid = libc::fork();
if pid == -1 { return };
if pid == 0 {
let arg0 = CString::new(b"slstatus" as &[u8]).unwrap();
let args = vec![arg0.as_ptr(), std::ptr::null()];
libc::execvp(arg0.as_ptr(), args.as_ptr());
let msg = CString::new(b"polytree-session: slstatus exec" as &[u8]).unwrap();
libc::perror(msg.as_ptr());
libc::exit(libc::EXIT_FAILURE);
}
});
let wm_status: i32 = 0;
libc::waitpid(wm_pid, wm_status as *mut i32, 0);
status_thread.join().unwrap();
libc::exit(libc::WEXITSTATUS(wm_status));
}