cli: handle WAYLAND_DISPLAY already being privileged
This commit is contained in:
parent
2dbf6aa483
commit
e9708b1184
1 changed files with 6 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ use {
|
|||
},
|
||||
},
|
||||
ahash::AHashMap,
|
||||
isnt::std_1::primitive::IsntSliceExt,
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
collections::VecDeque,
|
||||
|
|
@ -155,7 +156,11 @@ impl ToolClient {
|
|||
Ok(d) => d,
|
||||
Err(_) => return Err(ToolClientError::WaylandDisplayNotSet),
|
||||
};
|
||||
let path = format_ustr!("{}/{}.jay", xrd, wd);
|
||||
let mut path = format_ustr!("{}/{}", xrd, wd);
|
||||
let suffix = b".jay";
|
||||
if path.not_ends_with(suffix) {
|
||||
path.push(suffix.as_slice());
|
||||
}
|
||||
let socket = match uapi::socket(c::AF_UNIX, c::SOCK_STREAM | c::SOCK_CLOEXEC, 0) {
|
||||
Ok(s) => Rc::new(s),
|
||||
Err(e) => return Err(ToolClientError::CreateSocket(e.into())),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue