From aab15b8d9a9d5d869659915c3d0995929ae4179b Mon Sep 17 00:00:00 2001 From: Sebastien Estienne Date: Thu, 30 Jun 2005 22:55:20 +0000 Subject: * moved AVAHI_RUNTIME_DIR and AVAHI_SOCKET in configure.ac * avahi-dnsconf and avahi use them for pid and socket file * check that ${prefix} is fully expanded in config.h * cosmetic changes in configure.ac git-svn-id: file:///home/lennart/svn/public/avahi/trunk@158 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-daemon/Makefile.am | 6 +++--- avahi-daemon/simple-protocol.c | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'avahi-daemon') diff --git a/avahi-daemon/Makefile.am b/avahi-daemon/Makefile.am index 4c943e4..6ad5421 100644 --- a/avahi-daemon/Makefile.am +++ b/avahi-daemon/Makefile.am @@ -19,14 +19,13 @@ pkgsysconfdir=$(sysconfdir)/avahi servicedir=$(pkgsysconfdir)/services -dbusservicedir=$(DBUS_SYS_DIR) AM_CFLAGS= \ -I$(top_srcdir) \ -D_GNU_SOURCE \ -DAVAHI_SERVICE_DIRECTORY=\"$(servicedir)\" \ - -DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi.conf\" \ - -DAVAHI_RUNTIME_DIR=\"$(localstatedir)/run/avahi\" + -DAVAHI_CONFIG_FILE=\"$(pkgsysconfdir)/avahi.conf\" + AM_LDADD=-lexpat @@ -67,6 +66,7 @@ pkgdata_DATA = \ if ENABLE_DBUS avahi_SOURCES += dbus-protocol.c dbus-protocol.h +dbusservicedir = $(DBUS_SYS_DIR) dbusservice_DATA = avahi-dbus.conf EXTRA_DIST = $(dbusservice_DATA) diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c index 274568c..87c9ee6 100644 --- a/avahi-daemon/simple-protocol.c +++ b/avahi-daemon/simple-protocol.c @@ -41,8 +41,6 @@ #define BUFFER_SIZE (20*1024) -#define UNIX_SOCKET AVAHI_RUNTIME_DIR "/socket" - #define CLIENTS_MAX 50 typedef struct Client Client; @@ -423,14 +421,14 @@ int simple_protocol_setup(GMainContext *c) { memset(&sa, 0, sizeof(sa)); sa.sun_family = AF_LOCAL; - strncpy(sa.sun_path, UNIX_SOCKET, sizeof(sa.sun_path)-1); + strncpy(sa.sun_path, AVAHI_SOCKET, sizeof(sa.sun_path)-1); /* We simply remove existing UNIX sockets under this name. The Avahi daemons makes sure that it runs only once on a host, therefore sockets that already exist are stale and may be removed without any ill effects */ - unlink(UNIX_SOCKET); + unlink(AVAHI_SOCKET); if (bind(server->fd, &sa, sizeof(sa)) < 0) { avahi_log_warn("bind(): %s", strerror(errno)); @@ -471,7 +469,7 @@ void simple_protocol_shutdown(void) { client_free(server->clients); if (server->bind_successful) - unlink(UNIX_SOCKET); + unlink(AVAHI_SOCKET); if (server->fd >= 0) close(server->fd); -- cgit