Use XDG_RUNTIME_DIR for texlab.sock in linux (#1331)

This commit is contained in:
zefr0x 2025-01-29 21:22:27 +03:00 committed by GitHub
parent da6a6bbb9f
commit e01b909c6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 2 deletions

1
Cargo.lock generated
View file

@ -940,6 +940,7 @@ name = "ipc"
version = "0.0.0"
dependencies = [
"crossbeam-channel",
"dirs 6.0.0",
"expect-test",
"log",
"parser",

View file

@ -16,6 +16,7 @@ rust-version = "1.80"
anyhow = "1.0.95"
criterion = "0.5.1"
crossbeam-channel = "0.5.14"
dirs = "6.0.0"
expect-test = "1.5.1"
itertools = "0.13.0"
log = "0.4.25"

View file

@ -8,7 +8,7 @@ rust-version.workspace = true
[dependencies]
bibtex-utils = { path = "../bibtex-utils" }
dirs = "6.0.0"
dirs.workspace = true
distro = { path = "../distro" }
itertools.workspace = true
line-index = { path = "../line-index" }

View file

@ -8,6 +8,7 @@ rust-version.workspace = true
[dependencies]
crossbeam-channel.workspace = true
dirs.workspace = true
serde.workspace = true
serde_json.workspace = true
log.workspace = true

View file

@ -12,7 +12,9 @@ use std::os::unix::net::{UnixListener, UnixStream};
use uds_windows::{UnixListener, UnixStream};
fn socket_path() -> PathBuf {
std::env::temp_dir().join("texlab.sock")
dirs::runtime_dir()
.unwrap_or(std::env::temp_dir())
.join("texlab.sock")
}
pub fn send_request<T: Serialize>(msg: T) -> io::Result<()> {