]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix bug in the new CLOCK_MONOTONIC implementation. I was treating the
authorSimon Tatham <anakin@pobox.com>
Tue, 15 May 2012 22:19:21 +0000 (22:19 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 15 May 2012 22:19:21 +0000 (22:19 +0000)
nanoseconds field as a microseconds field, with hilarious consequences.

[originally from svn r9535]

unix/uxmisc.c

index 01e1299ddb36d5940246f4caf5acb3a4894ced3d..300fc543762140ba69065a4f3518e4aab9efda3b 100644 (file)
@@ -29,7 +29,7 @@ unsigned long getticks(void)
         struct timespec ts;
         if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)
             return ts.tv_sec * TICKSPERSEC +
-                ts.tv_nsec / (1000000 / TICKSPERSEC);
+                ts.tv_nsec / (1000000000 / TICKSPERSEC);
     }
 #endif
     {