summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan <okan@openbsd.org>2011-03-19 23:40:11 +0000
committerokan <okan@openbsd.org>2011-03-19 23:40:11 +0000
commitbd5070a85379d27e7cde9c71d045d98e4c0f3466 (patch)
tree654180b8334e33e2781c38711d2b24f2dac9daaf
parentfix rdr-to example (requires direction); from James Turner (diff)
downloadwireguard-openbsd-bd5070a85379d27e7cde9c71d045d98e4c0f3466.tar.xz
wireguard-openbsd-bd5070a85379d27e7cde9c71d045d98e4c0f3466.zip
use timerclear macro
ok henning@
-rw-r--r--usr.sbin/ntpd/ntpd.c5
-rw-r--r--usr.sbin/timed/timed/candidate.c5
-rw-r--r--usr.sbin/timed/timed/master.c5
-rw-r--r--usr.sbin/timed/timed/readmsg.c4
-rw-r--r--usr.sbin/timed/timed/timed.c8
5 files changed, 12 insertions, 15 deletions
diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c
index 25d7a21cfba..02a5e52c697 100644
--- a/usr.sbin/ntpd/ntpd.c
+++ b/usr.sbin/ntpd/ntpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntpd.c,v 1.68 2010/07/01 22:16:20 eric Exp $ */
+/* $OpenBSD: ntpd.c,v 1.69 2011/03/19 23:40:11 okan Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -345,8 +345,7 @@ reset_adjtime(void)
{
struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = 0;
+ timerclear(&tv);
if (adjtime(&tv, NULL) == -1)
log_warn("reset adjtime failed");
}
diff --git a/usr.sbin/timed/timed/candidate.c b/usr.sbin/timed/timed/candidate.c
index 264cc12b583..88585f13830 100644
--- a/usr.sbin/timed/timed/candidate.c
+++ b/usr.sbin/timed/timed/candidate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: candidate.c,v 1.7 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: candidate.c,v 1.8 2011/03/19 23:40:11 okan Exp $ */
/*-
* Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -53,8 +53,7 @@ election(net)
* and give up. This results in network storms when several machines
* do it at once.
*/
- wait.tv_sec = 0;
- wait.tv_usec = 0;
+ timerclear(&wait);
while (0 != readmsg(TSP_REFUSE, ANYADDR, &wait, net)) {
if (trace)
fprintf(fd, "election: discarded stale REFUSE\n");
diff --git a/usr.sbin/timed/timed/master.c b/usr.sbin/timed/timed/master.c
index dd8896079f0..b8bc29d7dd1 100644
--- a/usr.sbin/timed/timed/master.c
+++ b/usr.sbin/timed/timed/master.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: master.c,v 1.10 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: master.c,v 1.11 2011/03/19 23:40:11 okan Exp $ */
/*-
* Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -423,8 +423,7 @@ synch(long mydelta)
/*
* ack messages periodically
*/
- wait.tv_sec = 0;
- wait.tv_usec = 0;
+ timerclear(&wait);
if (0 != readmsg(TSP_TRACEON,ANYADDR,
&wait,0))
traceon();
diff --git a/usr.sbin/timed/timed/readmsg.c b/usr.sbin/timed/timed/readmsg.c
index 8a71bf18ff0..c7f4ee8b506 100644
--- a/usr.sbin/timed/timed/readmsg.c
+++ b/usr.sbin/timed/timed/readmsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readmsg.c,v 1.16 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: readmsg.c,v 1.17 2011/03/19 23:40:11 okan Exp $ */
/*-
* Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -167,7 +167,7 @@ again:
(void)gettimeofday(&rtime, 0);
timersub(&rtout, &rtime, &rwait);
if (rwait.tv_sec < 0)
- rwait.tv_sec = rwait.tv_usec = 0;
+ timerclear(&rwait);
else if (rwait.tv_sec == 0
&& rwait.tv_usec < 1000000/CLK_TCK)
rwait.tv_usec = 1000000/CLK_TCK;
diff --git a/usr.sbin/timed/timed/timed.c b/usr.sbin/timed/timed/timed.c
index bd42eff30c3..b42ca1981ba 100644
--- a/usr.sbin/timed/timed/timed.c
+++ b/usr.sbin/timed/timed/timed.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timed.c,v 1.29 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: timed.c,v 1.30 2011/03/19 23:40:11 okan Exp $ */
/*-
* Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -477,7 +477,7 @@ lookformaster(struct netinfo *ntp)
* slave, postponing election of a master until first
* timer expires.
*/
- ntime.tv_sec = ntime.tv_usec = 0;
+ timerclear(&ntime);
answer = readmsg(TSP_MASTERREQ, ANYADDR, &ntime, ntp);
if (answer != NULL) {
if (!good_host_name(answer->tsp_name)) {
@@ -487,7 +487,7 @@ lookformaster(struct netinfo *ntp)
return;
}
- ntime.tv_sec = ntime.tv_usec = 0;
+ timerclear(&ntime);
answer = readmsg(TSP_MASTERUP, ANYADDR, &ntime, ntp);
if (answer != NULL) {
if (!good_host_name(answer->tsp_name)) {
@@ -497,7 +497,7 @@ lookformaster(struct netinfo *ntp)
return;
}
- ntime.tv_sec = ntime.tv_usec = 0;
+ timerclear(&ntime);
answer = readmsg(TSP_ELECTION, ANYADDR, &ntime, ntp);
if (answer != NULL) {
if (!good_host_name(answer->tsp_name)) {