summaryrefslogtreecommitdiffstats
path: root/lib/libc/time
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-02-10 01:24:28 +0000
committertedu <tedu@openbsd.org>2015-02-10 01:24:28 +0000
commit2824c1f2c20d88996f2a2ca737b767bcd3ac638a (patch)
tree89e228d3b0be0bc63fe124e39b30a211c1430af4 /lib/libc/time
parentIf 'write' is issued after a 'reinit' command, and the MBR to be (diff)
downloadwireguard-openbsd-2824c1f2c20d88996f2a2ca737b767bcd3ac638a.tar.xz
wireguard-openbsd-2824c1f2c20d88996f2a2ca737b767bcd3ac638a.zip
now we're cooking with gas...
replace difftime with a clever gift from matthew. ok guenther.
Diffstat (limited to 'lib/libc/time')
-rw-r--r--lib/libc/time/difftime.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc/time/difftime.c b/lib/libc/time/difftime.c
index 88b8024b82d..285e535f215 100644
--- a/lib/libc/time/difftime.c
+++ b/lib/libc/time/difftime.c
@@ -1,10 +1,13 @@
-/* $OpenBSD: difftime.c,v 1.11 2015/02/10 00:58:28 tedu Exp $ */
-/* This file is placed in the public domain by Ted Unangst. */
+/* $OpenBSD: difftime.c,v 1.12 2015/02/10 01:24:28 tedu Exp $ */
+/* This file is placed in the public domain by Matthew Dempsky. */
#include "private.h"
+#define HI(t) ((double)(t & 0xffffffff00000000LL))
+#define LO(t) ((double)(t & 0x00000000ffffffffLL))
+
double
-difftime(time_t time1, time_t time0)
+difftime(time_t t1, time_t t0)
{
- return time1 - (double)time0;
+ return (HI(t1) - HI(t0)) + (LO(t1) - LO(t0));
}