Merge pull request #833 from mahkoh/jorth/tool-client-privileged
cli: handle WAYLAND_DISPLAY already being privileged
This commit is contained in:
commit
4c7d108e09
1 changed files with 6 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ use {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ahash::AHashMap,
|
ahash::AHashMap,
|
||||||
|
isnt::std_1::primitive::IsntSliceExt,
|
||||||
std::{
|
std::{
|
||||||
cell::{Cell, RefCell},
|
cell::{Cell, RefCell},
|
||||||
collections::VecDeque,
|
collections::VecDeque,
|
||||||
|
|
@ -155,7 +156,11 @@ impl ToolClient {
|
||||||
Ok(d) => d,
|
Ok(d) => d,
|
||||||
Err(_) => return Err(ToolClientError::WaylandDisplayNotSet),
|
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) {
|
let socket = match uapi::socket(c::AF_UNIX, c::SOCK_STREAM | c::SOCK_CLOEXEC, 0) {
|
||||||
Ok(s) => Rc::new(s),
|
Ok(s) => Rc::new(s),
|
||||||
Err(e) => return Err(ToolClientError::CreateSocket(e.into())),
|
Err(e) => return Err(ToolClientError::CreateSocket(e.into())),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue