aboutsummaryrefslogtreecommitdiff
path: root/libexec/rbootd
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2012-09-01 14:45:15 +0000
committerEd Schouten <ed@FreeBSD.org>2012-09-01 14:45:15 +0000
commit902d9eafbf66c52f8513bc38f4d0c8063c0b8a03 (patch)
tree496a0b9a3b14c27d50e1ae3b28265ecf5c2023f2 /libexec/rbootd
parentaeb99b567a54f0ce25c0cf33eb758f15add4580c (diff)
downloadsrc-902d9eafbf66c52f8513bc38f4d0c8063c0b8a03.tar.gz
src-902d9eafbf66c52f8513bc38f4d0c8063c0b8a03.zip
Notes
Diffstat (limited to 'libexec/rbootd')
-rw-r--r--libexec/rbootd/rbootd.c7
-rw-r--r--libexec/rbootd/rmpproto.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/libexec/rbootd/rbootd.c b/libexec/rbootd/rbootd.c
index e56a3e77a428..1d35bd1e2eeb 100644
--- a/libexec/rbootd/rbootd.c
+++ b/libexec/rbootd/rbootd.c
@@ -310,16 +310,15 @@ void
DoTimeout(void)
{
RMPCONN *rtmp;
- struct timeval now;
-
- (void) gettimeofday(&now, (struct timezone *)0);
+ time_t now;
/*
* For each active connection, if RMP_TIMEOUT seconds have passed
* since the last packet was sent, delete the connection.
*/
+ now = time(NULL);
for (rtmp = RmpConns; rtmp != NULL; rtmp = rtmp->next)
- if ((rtmp->tstamp.tv_sec + RMP_TIMEOUT) < now.tv_sec) {
+ if ((rtmp->tstamp.tv_sec + RMP_TIMEOUT) < now) {
syslog(LOG_WARNING, "%s: connection timed out (%u)",
EnetStr(rtmp), rtmp->rmp.r_type);
RemoveConn(rtmp);
diff --git a/libexec/rbootd/rmpproto.c b/libexec/rbootd/rmpproto.c
index 8d51445165ad..d37ef852415a 100644
--- a/libexec/rbootd/rmpproto.c
+++ b/libexec/rbootd/rmpproto.c
@@ -575,7 +575,7 @@ SendPacket(RMPCONN *rconn)
/*
* Last time this connection was active.
*/
- (void) gettimeofday(&rconn->tstamp, (struct timezone *)0);
+ (void)gettimeofday(&rconn->tstamp, NULL);
if (DbgFp != NULL) /* display packet */
DispPkt(rconn,DIR_SENT);