[Git][NTPsec/ntpsec][master] 3 commits: Remove more #ifdef RLIMIT_xxx that I missed yesterday
Hal Murray
gitlab at mg.gitlab.com
Tue Sep 17 18:59:31 UTC 2019
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
fb0c11c9 by Hal Murray at 2019-09-17T07:06:36Z
Remove more #ifdef RLIMIT_xxx that I missed yesterday
- - - - -
7916ac39 by Hal Murray at 2019-09-17T07:07:33Z
Restore memlocking and an ifdef for RLIMIT_MEMLOCK
Thanks to Matt Selsky for catching my screwup.
- - - - -
df8223a5 by Hal Murray at 2019-09-17T18:22:03Z
Remove reference to unused ISC_PLATFORM_BRACEPTHREADONCEINIT
- - - - -
3 changed files:
- devel/ifdex-ignores
- ntpd/ntp_config.c
- ntpd/ntpd.c
Changes:
=====================================
devel/ifdex-ignores
=====================================
@@ -41,12 +41,6 @@ DEBUG_PARSELIB # Enable debugging in the parse library.
NTP_DEBUG_LISTS # Debug list handling
DEBUG_PPS720 # Only in refclock_true.c
-# AIX and Solaris had at one time a bug in the way they declared
-# PTHREAD_ONCE_INIT. This enables a workaround. It may no longer be
-# needed, so let's wait on report rather than pre-complexifying the
-# waf logic.
-ISC_PLATFORM_BRACEPTHREADONCEINIT
-
# This is from a Python compatibility hack
PY_MAJOR_VERSION
=====================================
ntpd/ntp_config.c
=====================================
@@ -1897,27 +1897,17 @@ config_rlimit(
break;
case T_Stacksize:
-#if defined(RLIMIT_STACK)
ntp_rlimit(RLIMIT_STACK,
(rlim_t)(rlimit_av->value.i * 4096),
4096,
"4k");
-#else
- /* STDERR as well would be fine... */
- msyslog(LOG_WARNING, "CONFIG: 'rlimit stacksize' specified but is not available on this system.");
-#endif /* RLIMIT_STACK */
break;
case T_Filenum:
-#if defined(RLIMIT_NOFILE)
ntp_rlimit(RLIMIT_NOFILE,
(rlim_t)(rlimit_av->value.i),
1,
"");
-#else
- /* STDERR as well would be fine... */
- msyslog(LOG_WARNING, "CONFIG: 'rlimit filenum' specified but is not available on this system.");
-#endif /* RLIMIT_NOFILE */
break;
}
@@ -3632,9 +3622,6 @@ ntp_rlimit(
#endif
switch (rl_what) {
- case RLIMIT_MEMLOCK:
- /* ignore - for backward compatibility only */
- break;
case RLIMIT_NOFILE:
/*
=====================================
ntpd/ntpd.c
=====================================
@@ -802,11 +802,18 @@ ntpdmain(
* Need to do this before droproot.
*/
{
+#ifdef RLIMIT_MEMLOCK
+ /* RLIMIT_MEMLOCK is Linux/BSD, not POSIX */
struct rlimit rlim;
rlim.rlim_max = rlim.rlim_cur = RLIM_INFINITY;
if (setrlimit(RLIMIT_MEMLOCK, &rlim) < 0)
msyslog(LOG_WARNING, "INIT: setrlimit() failed: not locking into RAM");
else
+#endif
+
+ if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0)
+ msyslog(LOG_WARNING, "INIT: mlockall() failed: not locking into RAM");
+ else
msyslog(LOG_INFO, "INIT: successfully locked into RAM");
}
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/36128757fbb6613fc4cea2705cc3717fbd7dc7fb...df8223a5b4b55a4beb4bdd6f46df0c0688f295ec
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/36128757fbb6613fc4cea2705cc3717fbd7dc7fb...df8223a5b4b55a4beb4bdd6f46df0c0688f295ec
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190917/adfbb4f6/attachment-0001.htm>
More information about the vc
mailing list