0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-11-27 06:18:57 +00:00
termux-packages/x11-packages/eww/zbus-path.diff
2024-05-16 16:30:35 +08:00

32 lines
1.4 KiB
Diff

--- a/src/address.rs
+++ b/src/address.rs
@@ -410,7 +410,7 @@
Ok(val) => Self::from_str(&val),
_ => {
#[cfg(all(unix, not(target_os = "macos")))]
- return Self::from_str("unix:path=/var/run/dbus/system_bus_socket");
+ return Self::from_str("unix:path=@TERMUX_PREFIX@/var/run/dbus/system_bus_socket");
#[cfg(windows)]
return Self::from_str("autolaunch:");
--- a/src/fdo.rs
+++ b/src/fdo.rs
@@ -358,14 +358,14 @@
fn ping(&self) {}
fn get_machine_id(&self) -> Result<String> {
- let mut id = match std::fs::read_to_string("/var/lib/dbus/machine-id") {
+ let mut id = match std::fs::read_to_string("@TERMUX_PREFIX@/var/lib/dbus/machine-id") {
Ok(id) => id,
Err(e) => {
- if let Ok(id) = std::fs::read_to_string("/etc/machine-id") {
+ if let Ok(id) = std::fs::read_to_string("@TERMUX_PREFIX@/etc/machine-id") {
id
} else {
return Err(Error::IOError(format!(
- "Failed to read from /var/lib/dbus/machine-id or /etc/machine-id: {e}"
+ "Failed to read from @TERMUX_PREFIX@/var/lib/dbus/machine-id or @TERMUX_PREFIX@/etc/machine-id: {e}"
)));
}
}