X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-daemon%2Fmain.c;h=da198686b6c289db6f605e494e9d4550133d88f5;hb=0449977b92d08726abde0cd5c38473435c8228d3;hp=efb167e63a72e84858ac2c044ed2dc042272b40d;hpb=82244abd57cf04d554b3ab0fa92642d73d80b5c1;p=catta diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index efb167e..da19868 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -487,10 +487,6 @@ static int load_config_file(DaemonConfig *c) { c->server_config.use_iff_running = is_yes(p->value); else if (strcasecmp(p->key, "disallow-other-stacks") == 0) c->server_config.disallow_other_stacks = is_yes(p->value); - else if (strcasecmp(p->key, "disable-publishing") == 0) - c->server_config.disable_publishing = is_yes(p->value); - else if (strcasecmp(p->key, "disable-user-service-publishing") == 0) - c->disable_user_service_publishing = is_yes(p->value); #ifdef HAVE_DBUS else if (strcasecmp(p->key, "enable-dbus") == 0) { @@ -526,6 +522,10 @@ static int load_config_file(DaemonConfig *c) { c->server_config.publish_domain = is_yes(p->value); else if (strcasecmp(p->key, "publish-resolv-conf-dns-servers") == 0) c->publish_resolv_conf = is_yes(p->value); + else if (strcasecmp(p->key, "disable-publishing") == 0) + c->server_config.disable_publishing = is_yes(p->value); + else if (strcasecmp(p->key, "disable-user-service-publishing") == 0) + c->disable_user_service_publishing = is_yes(p->value); else if (strcasecmp(p->key, "add-service-cookie") == 0) c->server_config.add_service_cookie = is_yes(p->value); else if (strcasecmp(p->key, "publish-dns-servers") == 0) { @@ -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; @@ -968,7 +971,8 @@ static void enforce_rlimits(void) { 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