summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/mrinfo/mrinfo.c2
-rw-r--r--usr.sbin/rpc.lockd/procs.c18
-rw-r--r--usr.sbin/rtadvd/timer.c6
-rw-r--r--usr.sbin/rtsold/rtsold.c4
-rw-r--r--usr.sbin/traceroute/traceroute.c4
-rw-r--r--usr.sbin/wsmoused/wsmoused.c5
6 files changed, 19 insertions, 20 deletions
diff --git a/usr.sbin/mrinfo/mrinfo.c b/usr.sbin/mrinfo/mrinfo.c
index 9dc0a6fdfba..08962772dc3 100644
--- a/usr.sbin/mrinfo/mrinfo.c
+++ b/usr.sbin/mrinfo/mrinfo.c
@@ -419,7 +419,7 @@ main(int argc, char *argv[])
--tv.tv_sec;
}
if (tv.tv_sec < 0)
- tv.tv_sec = tv.tv_usec = 0;
+ timerclear(&tv);
count = poll(pfd, 1, tv.tv_sec * 1000);
diff --git a/usr.sbin/rpc.lockd/procs.c b/usr.sbin/rpc.lockd/procs.c
index 7d8acc9a15f..af8a71c5751 100644
--- a/usr.sbin/rpc.lockd/procs.c
+++ b/usr.sbin/rpc.lockd/procs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procs.c,v 1.13 2008/06/15 04:48:03 sturm Exp $ */
+/* $OpenBSD: procs.c,v 1.14 2011/03/22 10:16:23 okan Exp $ */
/*
* Copyright (c) 1995
@@ -204,8 +204,8 @@ transmit_result(int opcode, nlm_res *result, struct sockaddr_in *addr)
int success;
if ((cli = get_client(addr, NLM_VERS)) != NULL) {
- timeo.tv_sec = 0; /* No timeout - not expecting response */
- timeo.tv_usec = 0;
+ /* No timeout - not expecting response */
+ timerclear(&timeo);
success = clnt_call(cli, opcode, xdr_nlm_res,
result, xdr_void, &dummy, timeo);
@@ -232,8 +232,8 @@ transmit4_result(int opcode, nlm4_res *result, struct sockaddr_in *addr)
int success;
if ((cli = get_client(addr, NLM_VERS4)) != NULL) {
- timeo.tv_sec = 0; /* No timeout - not expecting response */
- timeo.tv_usec = 0;
+ /* No timeout - not expecting response */
+ timerclear(&timeo);
success = clnt_call(cli, opcode, xdr_nlm4_res,
result, xdr_void, &dummy, timeo);
@@ -360,8 +360,8 @@ nlm_test_msg_1_svc(nlm_testargs *arg, struct svc_req *rqstp)
*/
addr = svc_getcaller(rqstp->rq_xprt);
if ((cli = get_client(addr, NLM_VERS)) != NULL) {
- timeo.tv_sec = 0; /* No timeout - not expecting response */
- timeo.tv_usec = 0;
+ /* No timeout - not expecting response */
+ timerclear(&timeo);
success = clnt_call(cli, NLM_TEST_RES, xdr_nlm_testres,
&result, xdr_void, &dummy, timeo);
@@ -794,8 +794,8 @@ nlm4_test_msg_4_svc(nlm4_testargs *arg, struct svc_req *rqstp)
*/
addr = svc_getcaller(rqstp->rq_xprt);
if ((cli = get_client(addr, NLM_VERS4)) != NULL) {
- timeo.tv_sec = 0; /* No timeout - not expecting response */
- timeo.tv_usec = 0;
+ /* No timeout - not expecting response */
+ timerclear(&timeo);
success = clnt_call(cli, NLM4_TEST_RES, xdr_nlm4_testres,
&result, xdr_void, &dummy, timeo);
diff --git a/usr.sbin/rtadvd/timer.c b/usr.sbin/rtadvd/timer.c
index 055b6e93d43..d9ad519e4ca 100644
--- a/usr.sbin/rtadvd/timer.c
+++ b/usr.sbin/rtadvd/timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timer.c,v 1.9 2008/04/21 20:40:55 rainer Exp $ */
+/* $OpenBSD: timer.c,v 1.10 2011/03/22 10:16:23 okan Exp $ */
/* $KAME: timer.c,v 1.7 2002/05/21 14:26:55 itojun Exp $ */
/*
@@ -143,7 +143,7 @@ rtadvd_check_timer()
return(NULL);
} else if (TIMEVAL_LT(timer_head.tm, now)) {
/* this may occur when the interval is too small */
- returnval.tv_sec = returnval.tv_usec = 0;
+ timerclear(&returnval);
} else
TIMEVAL_SUB(&timer_head.tm, &now, &returnval);
return(&returnval);
@@ -157,7 +157,7 @@ rtadvd_timer_rest(struct rtadvd_timer *timer)
gettimeofday(&now, NULL);
if (TIMEVAL_LEQ(timer->tm, now)) {
log_debug("a timer must be expired, but not yet");
- returnval.tv_sec = returnval.tv_usec = 0;
+ timerclear(&returnval);
}
else
TIMEVAL_SUB(&timer->tm, &now, &returnval);
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c
index d26fa3442ab..dd09869f0cd 100644
--- a/usr.sbin/rtsold/rtsold.c
+++ b/usr.sbin/rtsold/rtsold.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsold.c,v 1.45 2009/01/30 17:25:51 rainer Exp $ */
+/* $OpenBSD: rtsold.c,v 1.46 2011/03/22 10:16:23 okan Exp $ */
/* $KAME: rtsold.c,v 1.75 2004/01/03 00:00:07 itojun Exp $ */
/*
@@ -545,7 +545,7 @@ rtsol_check_timer(void)
return(NULL);
} else if (timercmp(&rtsol_timer, &now, <))
/* this may occur when the interval is too small */
- returnval.tv_sec = returnval.tv_usec = 0;
+ timerclear(&returnval);
else
timersub(&rtsol_timer, &now, &returnval);
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c
index 72b67f820e7..8a3eb6d640c 100644
--- a/usr.sbin/traceroute/traceroute.c
+++ b/usr.sbin/traceroute/traceroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: traceroute.c,v 1.73 2010/09/13 10:09:00 claudio Exp $ */
+/* $OpenBSD: traceroute.c,v 1.74 2011/03/22 10:16:23 okan Exp $ */
/* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */
/*-
@@ -855,7 +855,7 @@ wait_for_reply(int sock, struct sockaddr_in *from, struct timeval *sent)
wait.tv_sec--;
}
if (wait.tv_sec < 0)
- wait.tv_sec = wait.tv_usec = 0;
+ timerclear(&wait);
if (select(sock+1, fdsp, (fd_set *)0, (fd_set *)0, &wait) > 0)
cc = recvfrom(s, (char *)packet, sizeof(packet), 0,
diff --git a/usr.sbin/wsmoused/wsmoused.c b/usr.sbin/wsmoused/wsmoused.c
index ccf55e898e1..ea2d0b10362 100644
--- a/usr.sbin/wsmoused/wsmoused.c
+++ b/usr.sbin/wsmoused/wsmoused.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmoused.c,v 1.25 2009/06/21 16:13:18 jacekm Exp $ */
+/* $OpenBSD: wsmoused.c,v 1.26 2011/03/22 10:16:23 okan Exp $ */
/*
* Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon
@@ -276,8 +276,7 @@ mouse_click(struct wscons_event *event)
if (event->type == WSCONS_EVENT_MOUSE_DOWN) {
if (timercmp(&max_date, &buttonstate[i].tv, >)) {
- buttonstate[i].tv.tv_sec = 0;
- buttonstate[i].tv.tv_usec = 0;
+ timerclear(&buttonstate[i].tv);
buttonstate[i].count = 1;
} else {
buttonstate[i].count++;