From f2747e8c9adc1e3ca04630d35c9825ec715078e9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 9 Nov 2005 02:27:05 +0000 Subject: [PATCH] fix retval sending git-svn-id: file:///home/lennart/svn/public/avahi/trunk@941 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-daemon/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index efb167e..821820e 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -703,6 +703,7 @@ static int run_server(DaemonConfig *c) { int error; const AvahiPoll *poll_api = NULL; AvahiWatch *sig_watch = NULL; + int retval_is_sent = 0; assert(c); @@ -773,8 +774,10 @@ static int run_server(DaemonConfig *c) { update_wide_area_servers(); - if (c->daemonize) + if (c->daemonize) { daemon_retval_send(0); + retval_is_sent = 1; + } for (;;) { if ((r = avahi_simple_poll_iterate(simple_poll_api, -1)) < 0) { @@ -819,7 +822,7 @@ finish: simple_poll_api = NULL; } - if (r != 0 && c->daemonize) + if (!retval_is_sent && c->daemonize) daemon_retval_send(1); return r; -- 2.7.4