Do not run slstatus
This commit is contained in:
parent
f3983a9f96
commit
80379d69d6
1 changed files with 0 additions and 18 deletions
18
src/main.rs
18
src/main.rs
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue