]> arthur.barton.de Git - netatalk.git/commitdiff
Log warnings instead of exiting when increasing rlimits doesn't work out
authorFrank Lahm <franklahm@googlemail.com>
Wed, 2 Nov 2011 14:04:35 +0000 (15:04 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 2 Nov 2011 14:04:35 +0000 (15:04 +0100)
etc/afpd/main.c

index e8365a2848770efd0366e0e78d78e77e0ab403cc..edcfe6a7565d8339e5239b8ecead0a39fb66a821 100644 (file)
@@ -228,16 +228,16 @@ static int setlimits(void)
     struct rlimit rlim;
 
     if (getrlimit(RLIMIT_NOFILE, &rlim) != 0) {
-        LOG(log_error, logtype_afpd, "setlimits: %s", strerror(errno));
-        exit(1);
+        LOG(log_warning, logtype_afpd, "setlimits: reading current limits failed: %s", strerror(errno));
+        return -1;
     }
     if (rlim.rlim_cur != RLIM_INFINITY && rlim.rlim_cur < 65535) {
         rlim.rlim_cur = 65535;
         if (rlim.rlim_max != RLIM_INFINITY && rlim.rlim_max < 65535)
             rlim.rlim_max = 65535;
         if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) {
-            LOG(log_error, logtype_afpd, "setlimits: %s", strerror(errno));
-            exit(1);
+            LOG(log_warning, logtype_afpd, "setlimits: increasing limits failed: %s", strerror(errno));
+            return -1;
         }
     }
     return 0;