summaryrefslogtreecommitdiffstats
path: root/avahi-daemon
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-daemon')
-rw-r--r--avahi-daemon/Makefile.am2
-rw-r--r--avahi-daemon/main.c12
2 files changed, 8 insertions, 6 deletions
diff --git a/avahi-daemon/Makefile.am b/avahi-daemon/Makefile.am
index 3762ba5..2f09490 100644
--- a/avahi-daemon/Makefile.am
+++ b/avahi-daemon/Makefile.am
@@ -22,6 +22,8 @@ servicedir=$(pkgsysconfdir)/services
AM_CFLAGS= \
-I$(top_srcdir) \
+ -DAVAHI_DAEMON_RUNTIME_DIR=\"$(avahi_runtime_dir)/avahi-daemon/\" \
+ -DAVAHI_SOCKET=\"$(avahi_socket)\" \
-DAVAHI_SERVICE_DIRECTORY=\"$(servicedir)\" \
-DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi.conf\"
diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c
index ce82664..ab17a9c 100644
--- a/avahi-daemon/main.c
+++ b/avahi-daemon/main.c
@@ -625,7 +625,7 @@ static gint drop_root(void) {
}
static const char* pid_file_proc(void) {
- return AVAHI_RUNTIME_DIR"/avahi-daemon.pid";
+ return AVAHI_DAEMON_RUNTIME_DIR"/pid";
}
static gint make_runtime_dir(void) {
@@ -649,20 +649,20 @@ static gint make_runtime_dir(void) {
u = umask(0000);
reset_umask = TRUE;
- if (mkdir(AVAHI_RUNTIME_DIR, 0755) < 0 && errno != EEXIST) {
- avahi_log_error("mkdir(\""AVAHI_RUNTIME_DIR"\"): %s", strerror(errno));
+ if (mkdir(AVAHI_DAEMON_RUNTIME_DIR, 0755) < 0 && errno != EEXIST) {
+ avahi_log_error("mkdir(\""AVAHI_DAEMON_RUNTIME_DIR"\"): %s", strerror(errno));
goto fail;
}
- chown(AVAHI_RUNTIME_DIR, pw->pw_uid, gr->gr_gid);
+ chown(AVAHI_DAEMON_RUNTIME_DIR, pw->pw_uid, gr->gr_gid);
- if (stat(AVAHI_RUNTIME_DIR, &st) < 0) {
+ if (stat(AVAHI_DAEMON_RUNTIME_DIR, &st) < 0) {
avahi_log_error("stat(): %s\n", strerror(errno));
goto fail;
}
if (!S_ISDIR(st.st_mode) || st.st_uid != pw->pw_uid || st.st_gid != gr->gr_gid) {
- avahi_log_error("Failed to create runtime directory "AVAHI_RUNTIME_DIR".");
+ avahi_log_error("Failed to create runtime directory "AVAHI_DAEMON_RUNTIME_DIR".");
goto fail;
}