aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/watchdogd
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2012-11-03 18:38:28 +0000
committerXin LI <delphij@FreeBSD.org>2012-11-03 18:38:28 +0000
commit652c42600b63aa68fb6de4dbfc3d49ec9610b01b (patch)
tree189cba1dc2eeed04cdac2f265ac34711dcf9889e /usr.sbin/watchdogd
parent19d41533294e14c547b5a1d5738648a2c46ebc3e (diff)
downloadsrc-652c42600b63aa68fb6de4dbfc3d49ec9610b01b.tar.gz
src-652c42600b63aa68fb6de4dbfc3d49ec9610b01b.zip
Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency.
MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=242519
Diffstat (limited to 'usr.sbin/watchdogd')
-rw-r--r--usr.sbin/watchdogd/Makefile4
-rw-r--r--usr.sbin/watchdogd/watchdogd.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/watchdogd/Makefile b/usr.sbin/watchdogd/Makefile
index be69d2bf5a84..5df7946cb1f7 100644
--- a/usr.sbin/watchdogd/Makefile
+++ b/usr.sbin/watchdogd/Makefile
@@ -4,8 +4,8 @@ PROG= watchdogd
LINKS= ${BINDIR}/watchdogd ${BINDIR}/watchdog
MAN= watchdogd.8 watchdog.8
-LDADD= -lm -lutil
-DPADD= ${LIBM} ${LIBUTIL}
+LDADD= -lutil
+DPADD= ${LIBUTIL}
.include <bsd.prog.mk>
diff --git a/usr.sbin/watchdogd/watchdogd.c b/usr.sbin/watchdogd/watchdogd.c
index cce84e1d9a1e..8194f963a56a 100644
--- a/usr.sbin/watchdogd/watchdogd.c
+++ b/usr.sbin/watchdogd/watchdogd.c
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <sysexits.h>
#include <unistd.h>
@@ -280,7 +281,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);