From owner-svn-src-stable-7@FreeBSD.ORG Mon Dec 3 18:31:34 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6EE4E888; Mon, 3 Dec 2012 18:31:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 361108FC08; Mon, 3 Dec 2012 18:31:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB3IVYLt004698; Mon, 3 Dec 2012 18:31:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3IVY0v004696; Mon, 3 Dec 2012 18:31:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212031831.qB3IVY0v004696@svn.freebsd.org> From: Xin LI Date: Mon, 3 Dec 2012 18:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243822 - stable/7/usr.sbin/watchdogd X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2012 18:31:34 -0000 Author: delphij Date: Mon Dec 3 18:31:33 2012 New Revision: 243822 URL: http://svnweb.freebsd.org/changeset/base/243822 Log: MFC r242519: Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency. Modified: stable/7/usr.sbin/watchdogd/Makefile stable/7/usr.sbin/watchdogd/watchdogd.c Directory Properties: stable/7/usr.sbin/watchdogd/ (props changed) Modified: stable/7/usr.sbin/watchdogd/Makefile ============================================================================== --- stable/7/usr.sbin/watchdogd/Makefile Mon Dec 3 18:30:52 2012 (r243821) +++ stable/7/usr.sbin/watchdogd/Makefile Mon Dec 3 18:31:33 2012 (r243822) @@ -5,8 +5,8 @@ LINKS= ${BINDIR}/watchdogd ${BINDIR}/wat MAN= watchdogd.8 watchdog.8 WARNS?= 6 -LDADD= -lm -lutil -DPADD= ${LIBM} ${LIBUTIL} +LDADD= -lutil +DPADD= ${LIBUTIL} .include Modified: stable/7/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- stable/7/usr.sbin/watchdogd/watchdogd.c Mon Dec 3 18:30:52 2012 (r243821) +++ stable/7/usr.sbin/watchdogd/watchdogd.c Mon Dec 3 18:31:33 2012 (r243822) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -277,7 +278,7 @@ parseargs(int argc, char *argv[]) if (a == 0) timeout = WD_TO_NEVER; else - timeout = 1.0 + log(a * 1e9) / log(2.0); + timeout = flsll(a * 1e9); if (debugging) printf("Timeout is 2^%d nanoseconds\n", timeout);