From owner-svn-src-stable-8@FreeBSD.ORG Mon Oct 25 15:17:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9963E106564A; Mon, 25 Oct 2010 15:17:31 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86E7D8FC08; Mon, 25 Oct 2010 15:17:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9PFHVbs069188; Mon, 25 Oct 2010 15:17:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9PFHVT2069186; Mon, 25 Oct 2010 15:17:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201010251517.o9PFHVT2069186@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Oct 2010 15:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214345 - stable/8/usr.sbin/watchdogd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 15:17:31 -0000 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 __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -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();