summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-11 03:07:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:40 -0500
commita7a5c98e296763c541daac2e6175ead8ede34c64 (patch)
tree99db3caf9951566d2ed2d6b7a8dc1150c511680d /source4
parentfdfa2adcb1f6771c1c2d45dd65f48b299d2b712b (diff)
downloadsamba-a7a5c98e296763c541daac2e6175ead8ede34c64.tar.gz
samba-a7a5c98e296763c541daac2e6175ead8ede34c64.tar.bz2
samba-a7a5c98e296763c541daac2e6175ead8ede34c64.zip
r4669: a timeval_to_nttime() function as requested by abartlet. Andrew, its
your responsibility to use/test this :-) (This used to be commit 2107b0cd7661a631952742bae241cb165b05c5f2)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/time.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/lib/time.c b/source4/lib/time.c
index 504b5d6ac3..92eb2dee5e 100644
--- a/source4/lib/time.c
+++ b/source4/lib/time.c
@@ -536,3 +536,13 @@ struct timeval timeval_diff(struct timeval *tv1, struct timeval *tv2)
}
return t;
}
+
+
+/*
+ convert a timeval to a NTTIME
+*/
+NTTIME timeval_to_nttime(struct timeval *tv)
+{
+ double t1 = tv->tv_sec + (tv->tv_usec*1.0e-6);
+ return (t1 + TIME_FIXUP_CONSTANT) * 1.0e7;
+}