xwayland: kill xwayland when wayland connection fails
This commit is contained in:
parent
9840150e40
commit
8b9784bb15
6 changed files with 42 additions and 1 deletions
23
src/utils/pidfd_send_signal.rs
Normal file
23
src/utils/pidfd_send_signal.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use {
|
||||
crate::utils::oserror::OsError,
|
||||
c::{c_int, syscall},
|
||||
std::{ptr, rc::Rc},
|
||||
uapi::{
|
||||
OwnedFd,
|
||||
c::{self, SYS_pidfd_send_signal, siginfo_t},
|
||||
map_err,
|
||||
},
|
||||
};
|
||||
|
||||
pub fn pidfd_send_signal(pidfd: &Rc<OwnedFd>, signal: c_int) -> Result<(), OsError> {
|
||||
let res = unsafe {
|
||||
syscall(
|
||||
SYS_pidfd_send_signal,
|
||||
pidfd.raw(),
|
||||
signal,
|
||||
ptr::null_mut::<siginfo_t>(),
|
||||
0,
|
||||
)
|
||||
};
|
||||
map_err!(res).map(drop).map_err(|e| e.into())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue