1
0
Fork 0
forked from wry/wry

Merge pull request #833 from mahkoh/jorth/tool-client-privileged

cli: handle WAYLAND_DISPLAY already being privileged
This commit is contained in:
mahkoh 2026-03-23 20:39:43 +01:00 committed by GitHub
commit 4c7d108e09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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())),