From bd87429313ded2ad2eaafcd7d3eaef3de39ae781 Mon Sep 17 00:00:00 2001 From: Harlan Stenn Date: Fri, 8 May 2015 04:59:19 +0000 Subject: [PATCH] Clean up the RLIMIT_STACK code bk: 554c42a7U6yT8ZUavF8syZHhD-DOPA --- ChangeLog | 1 + ntpd/ntp_config.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30372087b..88b762349 100644 --- 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. diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index a0575d98e..cd734c326 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -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; -- 2.47.3