svn commit: r243821 - stable/8/usr.sbin/watchdogd

Xin LI delphij at FreeBSD.org
Mon Dec 3 18:30:52 UTC 2012


Author: delphij
Date: Mon Dec  3 18:30:52 2012
New Revision: 243821
URL: http://svnweb.freebsd.org/changeset/base/243821

Log:
  MFC r242519:
  
  Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency.

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

Modified: stable/8/usr.sbin/watchdogd/Makefile
==============================================================================
--- stable/8/usr.sbin/watchdogd/Makefile	Mon Dec  3 18:30:12 2012	(r243820)
+++ stable/8/usr.sbin/watchdogd/Makefile	Mon Dec  3 18:30:52 2012	(r243821)
@@ -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 <bsd.prog.mk>
 

Modified: stable/8/usr.sbin/watchdogd/watchdogd.c
==============================================================================
--- stable/8/usr.sbin/watchdogd/watchdogd.c	Mon Dec  3 18:30:12 2012	(r243820)
+++ stable/8/usr.sbin/watchdogd/watchdogd.c	Mon Dec  3 18:30:52 2012	(r243821)
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <sysexits.h>
 #include <unistd.h>
 
@@ -282,7 +283,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);


More information about the svn-src-stable-8 mailing list