summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-07-04 19:52:25 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-07-04 19:52:25 +0000
commit9b432fae1392142aba999fa2ec6af9fc6e12b8b0 (patch)
tree3ad2273497f73c59d530de8ae726653c64dc4d21
parent300b760e9b2462bf3922b313fdcf22d123a5a903 (diff)
simplify slightly
-rw-r--r--usr.sbin/ntpd/client.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/ntpd/client.c b/usr.sbin/ntpd/client.c
index 3cab1788e54..c1dd2c25fce 100644
--- a/usr.sbin/ntpd/client.c
+++ b/usr.sbin/ntpd/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.3 2004/07/04 11:01:49 alexander Exp $ */
+/* $OpenBSD: client.c,v 1.4 2004/07/04 19:52:24 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -100,7 +100,6 @@ client_dispatch(struct ntp_peer *p)
ssize_t size;
struct ntp_msg msg;
double T1, T2, T3, T4;
- double offset, error;
fsa_len = sizeof(fsa);
if ((size = recvfrom(p->query->fd, &buf, sizeof(buf), 0,
@@ -136,16 +135,14 @@ client_dispatch(struct ntp_peer *p)
T2 = lfp_to_d(msg.rectime);
T3 = lfp_to_d(msg.xmttime);
- offset = ((T2 - T1) + (T3 - T4)) / 2;
- error = (T2 - T1) - (T3 - T4);
+ p->offset = ((T2 - T1) + (T3 - T4)) / 2;
+ p->error = (T2 - T1) - (T3 - T4);
p->state = STATE_REPLY_RECEIVED;
p->next = time(NULL) + QUERY_INTERVAL;
p->deadline = 0;
- p->offset = offset;
- p->error = error;
- log_debug("reply received: offset %f error %f", offset, error);
+ log_debug("reply received: offset %f error %f", p->offset, p->error);
return (0);
}