]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn.
authorHarlan Stenn <stenn@ntp.org>
Mon, 5 Oct 2015 06:26:46 +0000 (06:26 +0000)
committerHarlan Stenn <stenn@ntp.org>
Mon, 5 Oct 2015 06:26:46 +0000 (06:26 +0000)
bk: 56121826z-c24tV9UZsWb5LXzMgDfA

ChangeLog
ntpd/ntp_config.c

index 675e812269e3dc7fdad03163aba279304d32e675..ae4fca08b91f2b5e791b792229ff49de51548d33 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
 * [Bug 2890] Ignore ENOBUFS on routing netlink socket.  Konstantin Khlebnikov.
 * [Bug 2906] make check needs better support for pthreads.  Harlan Stenn.
 * [Bug 2907] dist* build targets require our libevent/ to be enabled.  HStenn.
+* [Bug 2912] no munlockall() under Windows.  David Taylor, Harlan Stenn.
 * libntp/emalloc.c: Remove explicit include of stdint.h.  Harlan Stenn.
 * Put Unity CPPFLAGS items in unity_config.h.  Harlan Stenn.
 * tests/ntpd/g_leapsec.cpp typo fix.  Harlan Stenn.
index 85a8265f88d7e3c31faf493e4b2e17deb0eb9664..1c754bd1613d8d5a126362dc8df70f07e597c159 100644 (file)
@@ -2623,19 +2623,23 @@ config_rlimit(
                case T_Memlock:
                        /* What if we HAVE_OPT(SAVECONFIGQUIT) ? */
                        if (rlimit_av->value.i == -1) {
+# if defined(HAVE_MLOCKALL)
                                if (cur_memlock != 0) {
                                        if (-1 == munlockall()) {
                                                msyslog(LOG_ERR, "munlockall() failed: %m");
                                        }
                                }
                                cur_memlock = 0;
+# endif /* HAVE_MLOCKALL */
                        } else if (rlimit_av->value.i >= 0) {
 #if defined(RLIMIT_MEMLOCK)
+# if defined(HAVE_MLOCKALL)
                                if (cur_memlock != 1) {
                                        if (-1 == mlockall(MCL_CURRENT|MCL_FUTURE)) {
                                                msyslog(LOG_ERR, "mlockall() failed: %m");
                                        }
                                }
+# endif /* HAVE_MLOCKALL */
                                ntp_rlimit(RLIMIT_MEMLOCK,
                                           (rlim_t)(rlimit_av->value.i * 1024 * 1024),
                                           1024 * 1024,