diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-06-21 15:24:35 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-06-21 15:24:35 +0000 |
commit | 1a1f7c4245e5e4087c61692e66a3f4d56be04160 (patch) | |
tree | a407fb613a4d8e4f50f760eb64355f204e861a9f /sbin/dhclient/dispatch.c | |
parent | 5b2bfa3464754cb42cb8c3c3a2e6380577a04cba (diff) |
Consistently use time(&var) idiom rather than tossing in a few
var = time(NULL). Flip "struct interface *" to be the first
parameter in set_timeout(), as in other functions taking the
state info.
Diffstat (limited to 'sbin/dhclient/dispatch.c')
-rw-r--r-- | sbin/dhclient/dispatch.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 2cadceb3eaf..3e7a4bdbd98 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.125 2017/06/19 19:28:35 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.126 2017/06/21 15:24:34 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -276,10 +276,11 @@ interface_status(struct interface_info *ifi) } void -set_timeout(time_t secs, void (*where)(struct interface_info *), - struct interface_info *ifi) +set_timeout(struct interface_info *ifi, time_t secs, + void (*where)(struct interface_info *)) { - ifi->timeout = time(NULL) + secs; + time(&ifi->timeout); + ifi->timeout += secs; ifi->timeout_func = where; } |