avahi: Fix hardcoded paths

This commit is contained in:
Tee KOBAYASHI 2021-12-02 17:44:29 +09:00 committed by Henrik Grimler
parent 8ca1927be8
commit 719725c5d2
1 changed files with 21 additions and 0 deletions

View File

@ -1,5 +1,26 @@
--- a/avahi-daemon/main.c
+++ b/avahi-daemon/main.c
@@ -135,7 +135,7 @@
#endif
} DaemonConfig;
-#define RESOLV_CONF "/etc/resolv.conf"
+#define RESOLV_CONF "@TERMUX_PREFIX@/etc/resolv.conf"
#define BROWSE_DOMAINS_MAX 16
static AvahiSEntryGroup *dns_servers_entry_group = NULL;
@@ -587,9 +587,9 @@
int fd;
char buf[32];
- fd = open("/etc/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY);
+ fd = open("@TERMUX_PREFIX@/etc/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd == -1 && errno == ENOENT)
- fd = open("/var/lib/dbus/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY);
+ fd = open("@TERMUX_PREFIX@/var/lib/dbus/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd == -1)
return NULL;
@@ -1338,6 +1338,7 @@
#define set_env(key, value) putenv(avahi_strdup_printf("%s=%s", (key), (value)))