Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Oct 2010 15:17:31 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r214345 - stable/8/usr.sbin/watchdogd
Message-ID:  <201010251517.o9PFHVT2069186@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon Oct 25 15:17:31 2010
New Revision: 214345
URL: http://svn.freebsd.org/changeset/base/214345

Log:
  MFC r213181 by emaste:
  Protect the watchdog daemon against swap OOM killer.
  
  Sponsored by:	Sandvine Incorporated

Modified:
  stable/8/usr.sbin/watchdogd/watchdogd.c
Directory Properties:
  stable/8/usr.sbin/watchdogd/   (props changed)

Modified: stable/8/usr.sbin/watchdogd/watchdogd.c
==============================================================================
--- stable/8/usr.sbin/watchdogd/watchdogd.c	Mon Oct 25 15:11:10 2010	(r214344)
+++ stable/8/usr.sbin/watchdogd/watchdogd.c	Mon Oct 25 15:17:31 2010	(r214345)
@@ -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>
@@ -117,6 +118,8 @@ main(int argc, char *argv[])
 		signal(SIGTERM, sighandler);
 
 		pidfile_write(pfh);
+		if (madvise(0, 0, MADV_PROTECT) != 0)
+			warn("madvise failed");
 
 		watchdog_loop();
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010251517.o9PFHVT2069186>