summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/progressmeter.c
diff options
context:
space:
mode:
authordtucker <dtucker@openbsd.org>2013-06-01 13:15:51 +0000
committerdtucker <dtucker@openbsd.org>2013-06-01 13:15:51 +0000
commita0f898db1c60b07d0936054fd6cc6aa58e8b9f5b (patch)
treea8aed4bc3859bfd5487f149a2664734e79f349d0 /usr.bin/ssh/progressmeter.c
parentUpdate asr_hostaliases() to make all necessary checks in the function. (diff)
downloadwireguard-openbsd-a0f898db1c60b07d0936054fd6cc6aa58e8b9f5b.tar.xz
wireguard-openbsd-a0f898db1c60b07d0936054fd6cc6aa58e8b9f5b.zip
Use clock_gettime(CLOCK_MONOTONIC ...) for ssh timers so that things like
keepalives and rekeying will work properly over clock steps. Suggested by markus@, "looks good" djm@.
Diffstat (limited to 'usr.bin/ssh/progressmeter.c')
-rw-r--r--usr.bin/ssh/progressmeter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/progressmeter.c b/usr.bin/ssh/progressmeter.c
index b5b03db16c2..bee048f9aa1 100644
--- a/usr.bin/ssh/progressmeter.c
+++ b/usr.bin/ssh/progressmeter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: progressmeter.c,v 1.37 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: progressmeter.c,v 1.38 2013/06/01 13:15:52 dtucker Exp $ */
/*
* Copyright (c) 2003 Nils Nordman. All rights reserved.
*
@@ -128,7 +128,7 @@ refresh_progress_meter(void)
transferred = *counter - cur_pos;
cur_pos = *counter;
- now = time(NULL);
+ now = monotime();
bytes_left = end_pos - cur_pos;
if (bytes_left > 0)
@@ -246,7 +246,7 @@ update_progress_meter(int ignore)
void
start_progress_meter(char *f, off_t filesize, off_t *ctr)
{
- start = last_update = time(NULL);
+ start = last_update = monotime();
file = f;
end_pos = filesize;
cur_pos = 0;