]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/main.c
document that AVAHI_PROTO_xxx is no longer defined to be identical with AF_xxx
[catta] / avahi-daemon / main.c
index f64524a730e85bcaf1c4289135197b52cd5f2033..cf87e2371e2e8b7db8b8c790b2a9111a0f83accc 100644 (file)
@@ -39,6 +39,7 @@
 #include <stdlib.h>
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <sys/socket.h>
 
 #include <libdaemon/dfork.h>
 #include <libdaemon/dsignal.h>
@@ -129,9 +130,9 @@ static int load_resolv_conf(const DaemonConfig *c) {
         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;
 
@@ -203,11 +204,11 @@ static void remove_dns_server_entry_groups(void) {
 }
 
 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
@@ -842,9 +843,10 @@ static void set_one_rlimit(int resource, rlim_t limit, const char *name) {
 }
 
 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)
@@ -985,7 +987,7 @@ int main(int argc, char *argv[]) {
                 /** 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;
                 }