svn commit: r213181 - head/usr.sbin/watchdogd
Ed Maste
emaste at FreeBSD.org
Sun Sep 26 01:45:34 UTC 2010
Author: emaste
Date: Sun Sep 26 01:45:33 2010
New Revision: 213181
URL: http://svn.freebsd.org/changeset/base/213181
Log:
Protect the watchdog daemon against swap OOM killer. This is similar to
SVN r199804 which added protection to sshd, cron, syslogd, and inetd.
Modified:
head/usr.sbin/watchdogd/watchdogd.c
Modified: head/usr.sbin/watchdogd/watchdogd.c
==============================================================================
--- head/usr.sbin/watchdogd/watchdogd.c Sun Sep 26 01:41:53 2010 (r213180)
+++ head/usr.sbin/watchdogd/watchdogd.c Sun Sep 26 01:45:33 2010 (r213181)
@@ -31,6 +31,7 @@
#include <sys/types.h>
__FBSDID("$FreeBSD$");
+#include <sys/mman.h>
#include <sys/param.h>
#include <sys/rtprio.h>
#include <sys/stat.h>
@@ -115,6 +116,8 @@ main(int argc, char *argv[])
signal(SIGTERM, sighandler);
pidfile_write(pfh);
+ if (madvise(0, 0, MADV_PROTECT) != 0)
+ warn("madvise failed");
watchdog_loop();
More information about the svn-src-head
mailing list