Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency.

MFC after:	2 weeks
This commit is contained in:
Xin LI 2012-11-03 18:38:28 +00:00
parent 19d4153329
commit 652c42600b
2 changed files with 4 additions and 3 deletions

View File

@ -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>

View File

@ -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);