Repository: incubator-guacamole-server
Updated Branches:
  refs/heads/master 516c4a059 -> 039a1c52e


GUACAMOLE-239: When available, use CLOCK_MONOTONIC to prevent backwards running 
time


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/ddc1aa0b
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/ddc1aa0b
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/ddc1aa0b

Branch: refs/heads/master
Commit: ddc1aa0b5fe931c2127e91d5a7fff6f2de6be156
Parents: da7b77d
Author: Roman Stoffel <[email protected]>
Authored: Thu Mar 23 23:06:24 2017 +0100
Committer: Roman Stoffel <[email protected]>
Committed: Thu Mar 23 23:06:24 2017 +0100

----------------------------------------------------------------------
 src/libguac/timestamp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/ddc1aa0b/src/libguac/timestamp.c
----------------------------------------------------------------------
diff --git a/src/libguac/timestamp.c b/src/libguac/timestamp.c
index d3b79c6..0d2dc0a 100644
--- a/src/libguac/timestamp.c
+++ b/src/libguac/timestamp.c
@@ -33,9 +33,13 @@ guac_timestamp guac_timestamp_current() {
 
     struct timespec current;
 
-    /* Get current time */
+    /* Get current time, monotonically increasing */ 
+#ifdef CLOCK_MONOTONIC
+    clock_gettime(CLOCK_MONOTONIC, &current);
+#else
     clock_gettime(CLOCK_REALTIME, &current);
-    
+#endif    
+
     /* Calculate milliseconds */
     return (guac_timestamp) current.tv_sec * 1000 + current.tv_nsec / 1000000;
 

Reply via email to