#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <sys/socket.h>
#include <libdaemon/dfork.h>
#include <libdaemon/dsignal.h>
goto finish;
}
- resolv_conf = avahi_new0(char*, AVAHI_MAX_WIDE_AREA_SERVERS+1);
+ resolv_conf = avahi_new0(char*, AVAHI_WIDE_AREA_SERVERS_MAX+1);
- while (!feof(f) && i < AVAHI_MAX_WIDE_AREA_SERVERS) {
+ while (!feof(f) && i < AVAHI_WIDE_AREA_SERVERS_MAX) {
char ln[128];
char *p;
}
static void update_wide_area_servers(void) {
- AvahiAddress a[AVAHI_MAX_WIDE_AREA_SERVERS];
+ AvahiAddress a[AVAHI_WIDE_AREA_SERVERS_MAX];
unsigned n = 0;
char **p;
- for (p = resolv_conf; *p && n < AVAHI_MAX_WIDE_AREA_SERVERS; p++) {
+ for (p = resolv_conf; *p && n < AVAHI_WIDE_AREA_SERVERS_MAX; p++) {
if (!avahi_address_parse(*p, AVAHI_PROTO_UNSPEC, &a[n]))
avahi_log_warn("Failed to parse address '%s', ignoring.", *p);
else
avahi_server = s;
#ifdef HAVE_DBUS
- if (c->enable_dbus)
+ if (c->enable_dbus && state != AVAHI_SERVER_INVALID && state != AVAHI_SERVER_FAILURE)
dbus_protocol_server_state_changed(state);
#endif
daemon_log(log_level_map[level], "%s", txt);
}
-static void dump(const char *text, void* userdata) {
+static void dump(const char *text, AVAHI_GCC_UNUSED void* userdata) {
avahi_log_info("%s", text);
}
-static void signal_callback(AvahiWatch *watch, int fd, AvahiWatchEvent event, void *userdata) {
+static void signal_callback(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AVAHI_GCC_UNUSED AvahiWatchEvent event, AVAHI_GCC_UNUSED void *userdata) {
int sig;
const AvahiPoll *poll_api;
}
static void enforce_rlimits(void) {
-
+#ifdef RLIMIT_AS
if (config.rlimit_as_set)
set_one_rlimit(RLIMIT_AS, config.rlimit_as, "RLIMIT_AS");
+#endif
if (config.rlimit_core_set)
set_one_rlimit(RLIMIT_CORE, config.rlimit_core, "RLIMIT_CORE");
if (config.rlimit_data_set)
/** Parent **/
if ((ret = daemon_retval_wait(20)) < 0) {
- avahi_log_error("Could not recieve return value from daemon process.");
+ avahi_log_error("Could not receive return value from daemon process.");
goto finish;
}