From: Harlan Stenn Date: Thu, 24 Sep 2015 10:27:51 +0000 (+0000) Subject: More updates for bug 2817. Harlan Stenn. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6f4dd1443e91628c7316e8a925b95dfd5694608;p=thirdparty%2Fntp.git More updates for bug 2817. Harlan Stenn. bk: 5603d027uf4JuHmS_Ce_55H0XsrA1w --- diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index 2604f6464..71c021fca 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -785,13 +785,16 @@ ntpdmain( */ getconfig(argc, argv); - if (-1 == cur_memlock && -1 != DFLT_RLIMIT_MEMLOCK) { + if (-1 == cur_memlock) { # if defined(HAVE_MLOCKALL) /* * lock the process into memory */ - if (!HAVE_OPT(SAVECONFIGQUIT) && - 0 != mlockall(MCL_CURRENT|MCL_FUTURE)) + if ( !HAVE_OPT(SAVECONFIGQUIT) +# ifdef HAVE_SETRLIMIT + && -1 != DFLT_RLIMIT_MEMLOCK +# endif + && 0 != mlockall(MCL_CURRENT|MCL_FUTURE)) msyslog(LOG_ERR, "mlockall(): %m"); # else /* !HAVE_MLOCKALL follows */ # ifdef HAVE_PLOCK