From 15cbcb2d3c23c83f7ae5f009e20d5ba0eb4b3679 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 8 Aug 2005 10:45:47 +0000 Subject: [PATCH] * simply compilation a little * fix avahi-dnsconfd forking * clean up init script output a little git-svn-id: file:///home/lennart/svn/public/avahi/trunk@269 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/Makefile.am | 11 ++--------- avahi-core/Makefile.am | 22 +++++++++------------- avahi-daemon/main.c | 7 +++---- avahi-dnsconfd/main.c | 9 ++++++--- initscript/Debian/avahi-daemon.in | 2 +- initscript/Debian/avahi-dnsconfd.in | 2 +- 6 files changed, 22 insertions(+), 31 deletions(-) diff --git a/avahi-common/Makefile.am b/avahi-common/Makefile.am index 9030e04..c327bd1 100644 --- a/avahi-common/Makefile.am +++ b/avahi-common/Makefile.am @@ -49,9 +49,6 @@ noinst_PROGRAMS = \ lib_LTLIBRARIES = \ libavahi-common.la -noinst_LIBRARIES = \ - libavahi-common-static.a - libavahi_common_la_SOURCES = \ address.c address.h \ strlst.c strlst.h \ @@ -61,19 +58,15 @@ libavahi_common_la_SOURCES = \ libavahi_common_la_CFLAGS = $(AM_CFLAGS) libavahi_common_la_LIBADD = $(AM_LDADD) -libavahi_common_static_a_SOURCES = $(libavahi_common_la_SOURCES) -libavahi_common_static_a_CFLAGS = $(AM_CFLAGS) -libavahi_common_static_a_LIBADD = - strlst_test_SOURCES = \ strlst.c strlst.h \ - strlst-test.c + strlst-test.c strlst_test_CFLAGS = $(AM_CFLAGS) strlst_test_LDADD = $(AM_LDADD) alternative_test_SOURCES = \ alternative.c alternative.h \ - alternative-test.c + alternative-test.c alternative_test_CFLAGS = $(AM_CFLAGS) alternative_test_LDADD = $(AM_LDADD) diff --git a/avahi-core/Makefile.am b/avahi-core/Makefile.am index 2a2d134..8aad962 100644 --- a/avahi-core/Makefile.am +++ b/avahi-core/Makefile.am @@ -26,7 +26,6 @@ AM_LDADD=$(GLIB20_LIBS) # Import stuff from avahi-common AM_CFLAGS+=-I$(top_srcdir)/avahi-common COMMON_LDADD=../avahi-common/libavahi-common.la -STATIC_COMMON_LDADD=../avahi-common/libavahi-common-static.a # This cool debug trap works on i386/gcc only AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")' @@ -80,39 +79,36 @@ prioq_test_SOURCES = \ prioq-test.c \ prioq.c prioq.h prioq_test_CFLAGS = $(AM_CFLAGS) -prioq_test_LDADD = $(AM_LDADD) $(STATIC_COMMON_LDADD) +prioq_test_LDADD = $(AM_LDADD) $(COMMON_LDADD) avahi_test_SOURCES = \ - avahi-test.c \ - $(libavahi_core_la_SOURCES) + avahi-test.c avahi_test_CFLAGS = $(AM_CFLAGS) -avahi_test_LDADD = $(AM_LDADD) $(STATIC_COMMON_LDADD) +avahi_test_LDADD = $(AM_LDADD) $(COMMON_LDADD) libavahi-core.la conformance_test_SOURCES = \ - conformance-test.c \ - $(libavahi_core_la_SOURCES) + conformance-test.c conformance_test_CFLAGS = $(AM_CFLAGS) -conformance_test_LDADD = $(AM_LDADD) $(STATIC_COMMON_LDADD) +conformance_test_LDADD = $(AM_LDADD) $(COMMON_LDADD) libavahi-core.la avahi_reflector_SOURCES = \ - avahi-reflector.c \ - $(libavahi_core_la_SOURCES) + avahi-reflector.c avahi_reflector_CFLAGS = $(AM_CFLAGS) -avahi_reflector_LDADD = $(AM_LDADD) $(STATIC_COMMON_LDADD) +avahi_reflector_LDADD = $(AM_LDADD) $(COMMON_LDADD) libavahi-core.la dns_test_SOURCES = \ dns.c dns.h \ dns-test.c \ log.c log.h dns_test_CFLAGS = $(AM_CFLAGS) -dns_test_LDADD = $(AM_LDADD) $(STATIC_COMMON_LDADD) +dns_test_LDADD = $(AM_LDADD) $(COMMON_LDADD) timeeventq_test_SOURCES = \ timeeventq-test.c \ timeeventq.h timeeventq.c \ prioq.h prioq.c timeeventq_test_CFLAGS = $(AM_CFLAGS) -timeeventq_test_LDADD = $(AM_LDADD) $(STATIC_COMMON_LDADD) +timeeventq_test_LDADD = $(AM_LDADD) $(COMMON_LDADD) valgrind: avahi-test libtool --mode=execute valgrind ./avahi-test diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index 99bf860..480753e 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -538,10 +538,10 @@ static gint run_server(DaemonConfig *c) { static_service_load(); - if (c->daemonize) { + if (c->daemonize) daemon_retval_send(0); - r = 0; - } + + r = 0; g_main_loop_run(loop); @@ -558,7 +558,6 @@ finish: dbus_protocol_shutdown(); #endif - if (avahi_server) avahi_server_free(avahi_server); diff --git a/avahi-dnsconfd/main.c b/avahi-dnsconfd/main.c index db807da..9f854cc 100644 --- a/avahi-dnsconfd/main.c +++ b/avahi-dnsconfd/main.c @@ -411,7 +411,9 @@ static int run_daemon(void) { if (daemonize) daemon_retval_send(0); - + + ret = 0; + while (!quit) { fd_set rfds, wfds; @@ -498,8 +500,6 @@ static int run_daemon(void) { } } } - - ret = 0; finish: @@ -510,6 +510,9 @@ finish: daemon_signal_done(); + if (ret != 0 && daemonize) + daemon_retval_send(1); + return ret; } diff --git a/initscript/Debian/avahi-daemon.in b/initscript/Debian/avahi-daemon.in index b11d4d4..66aaee7 100755 --- a/initscript/Debian/avahi-daemon.in +++ b/initscript/Debian/avahi-daemon.in @@ -80,7 +80,7 @@ fi #set -e PATH=/sbin:/bin:/usr/sbin:/usr/bin -DESC="Avahi mDNS/DNS-SD daemon" +DESC="Avahi mDNS/DNS-SD Daemon" NAME="avahi-daemon" DAEMON="@sbindir@/$NAME" diff --git a/initscript/Debian/avahi-dnsconfd.in b/initscript/Debian/avahi-dnsconfd.in index 024d422..075d62c 100755 --- a/initscript/Debian/avahi-dnsconfd.in +++ b/initscript/Debian/avahi-dnsconfd.in @@ -80,7 +80,7 @@ fi #set -e PATH=/sbin:/bin:/usr/sbin:/usr/bin -DESC="Avahi Dns Config daemon" +DESC="Avahi Unicast DNS Configuration Daemon" NAME="avahi-dnsconfd" DAEMON="@sbindir@/$NAME" -- 2.39.5