int error;
const AvahiPoll *poll_api = NULL;
AvahiWatch *sig_watch = NULL;
+ int retval_is_sent = 0;
assert(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) {
simple_poll_api = NULL;
}
- if (r != 0 && c->daemonize)
+ if (!retval_is_sent && c->daemonize)
daemon_retval_send(1);
return r;
set_one_rlimit(RLIMIT_NPROC, config.rlimit_nproc, "RLIMIT_NPROC");
#endif
-#ifdef RLIMIT_MEMLOCK
+ /* the sysctl() call from iface-pfroute.c needs locked memory on FreeBSD */
+#if defined(RLIMIT_MEMLOCK) && !defined(__FreeBSD__)
/* We don't need locked memory */
set_one_rlimit(RLIMIT_MEMLOCK, 0, "RLIMIT_MEMLOCK");
#endif