]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
More updates for bug 2817. Harlan Stenn.
authorHarlan Stenn <stenn@ntp.org>
Thu, 24 Sep 2015 10:27:51 +0000 (10:27 +0000)
committerHarlan Stenn <stenn@ntp.org>
Thu, 24 Sep 2015 10:27:51 +0000 (10:27 +0000)
bk: 5603d027uf4JuHmS_Ce_55H0XsrA1w

ntpd/ntpd.c

index 2604f64645d127215a7f6ed2940c3c5ff172b212..71c021fca3f7e2f72f126baec1edba741846a77d 100644 (file)
@@ -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