summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/clnt_tcp.c
diff options
context:
space:
mode:
authorjca <jca@openbsd.org>2017-12-14 18:56:22 +0000
committerjca <jca@openbsd.org>2017-12-14 18:56:22 +0000
commitb8b77aada724385f4cb743271efa4fbf516ffa23 (patch)
tree235c421a4917b33f3da5cd5992d70fefc569f9b7 /lib/libc/rpc/clnt_tcp.c
parentMy previous commit broke the ramdisk build; fix it (diff)
downloadwireguard-openbsd-b8b77aada724385f4cb743271efa4fbf516ffa23.tar.xz
wireguard-openbsd-b8b77aada724385f4cb743271efa4fbf516ffa23.zip
Simplify and unify timespec variables used in those event loops
ok millert@
Diffstat (limited to 'lib/libc/rpc/clnt_tcp.c')
-rw-r--r--lib/libc/rpc/clnt_tcp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c
index 462e4ef3484..4c3034fc7ca 100644
--- a/lib/libc/rpc/clnt_tcp.c
+++ b/lib/libc/rpc/clnt_tcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clnt_tcp.c,v 1.30 2017/12/14 16:55:44 jca Exp $ */
+/* $OpenBSD: clnt_tcp.c,v 1.31 2017/12/14 18:56:22 jca Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -385,7 +385,7 @@ static int
readtcp(struct ct_data *ct, caddr_t buf, int len)
{
struct pollfd pfd[1];
- struct timespec start, after, duration, tmp, delta, wait;
+ struct timespec start, after, duration, delta, wait;
int r, save_errno;
if (len == 0)
@@ -402,8 +402,7 @@ readtcp(struct ct_data *ct, caddr_t buf, int len)
clock_gettime(CLOCK_MONOTONIC, &after);
timespecsub(&start, &after, &duration);
- timespecsub(&wait, &duration, &tmp);
- delta = tmp;
+ timespecsub(&wait, &duration, &delta);
if (delta.tv_sec < 0 || !timespecisset(&delta))
r = 0;