summaryrefslogtreecommitdiff
path: root/lib/util/time.c
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-09-03 17:50:54 +0200
committerStefan Metzmacher <metze@samba.org>2019-09-10 21:13:09 +0000
commitcca34da443ed6ee530fcf8c0def63d4b00527ffd (patch)
tree192da15750cbb97d7775eb0cc3b674d63733a3ed /lib/util/time.c
parent0318b68675d0318027ff5b6abf4a0d010839e6fd (diff)
downloadsamba-cca34da443ed6ee530fcf8c0def63d4b00527ffd.tar.gz
lib: add round_timespec_to_nttime()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 5403bb22e6cb39baf6dc1b91558744d41e9f6f64)
Diffstat (limited to 'lib/util/time.c')
-rw-r--r--lib/util/time.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/util/time.c b/lib/util/time.c
index bd067f84e8e..3a6043025f4 100644
--- a/lib/util/time.c
+++ b/lib/util/time.c
@@ -957,6 +957,15 @@ void round_timespec_to_usec(struct timespec *ts)
}
/****************************************************************************
+ Round a timespec to NTTIME resolution.
+****************************************************************************/
+
+void round_timespec_to_nttime(struct timespec *ts)
+{
+ ts->tv_nsec = (ts->tv_nsec / 100) * 100;
+}
+
+/****************************************************************************
Put a 8 byte filetime from a struct timespec. Uses GMT.
****************************************************************************/