]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Clean up the RLIMIT_STACK code
authorHarlan Stenn <stenn@ntp.org>
Fri, 8 May 2015 04:59:19 +0000 (04:59 +0000)
committerHarlan Stenn <stenn@ntp.org>
Fri, 8 May 2015 04:59:19 +0000 (04:59 +0000)
bk: 554c42a7U6yT8ZUavF8syZHhD-DOPA

ChangeLog
ntpd/ntp_config.c

index 30372087b2ec45b9c74ace27304b25d749e61651..88b76234912ecc42da78c7397f0de95ed80d56c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
 * [Bug 2815] net-snmp before v5.4 has circular library dependencies.
 * [Bug 2822] New leap column in sntp broke NTP::Util.pm.
 * [Bug 2825] Quiet file installation in html/ .
+* Clean up the RLIMIT_STACK code.
 * Improve the ntpq documentation around the controlkey keyid.
 * ntpq.c cleanup.
 * Windows port build cleanup.
index a0575d98e08e04bdaaf610ad423edb567f5220dc..cd734c3266af4fea2adc65804e8a988169cc16b4 100644 (file)
@@ -4938,7 +4938,7 @@ ntp_rlimit(
                DPRINTF(2, ("ntp_rlimit: STACK: %d %s pages\n",
                            (int)(rl_value / rl_scale), rl_sstr));
                if (-1 == getrlimit(RLIMIT_STACK, &rl)) {
-                       msyslog(LOG_ERR, "getrlimit() failed: %m");
+                       msyslog(LOG_ERR, "getrlimit(RLIMIT_STACK) failed: %m");
                } else {
                        if (rl_value > rl.rlim_max) {
                                msyslog(LOG_WARNING,
@@ -4947,9 +4947,10 @@ ntp_rlimit(
                                        (u_long)rl_value);
                                rl_value = rl.rlim_max;
                        }
+                       rl.rlim_cur = rl_value;
                        if (-1 == setrlimit(RLIMIT_STACK, &rl)) {
                                msyslog(LOG_ERR,
-                                       "ntp_rlimit: Cannot adjust stack limit: %m");
+                                       "ntp_rlimit: Cannot set RLIMIT_STACK: %m");
                        }
                }
                break;