]> granicus.if.org Git - zfs/commitdiff
Minor 32-bit fix cast to hrtime_t before the mutliply.
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 23 May 2010 16:51:17 +0000 (09:51 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 23 May 2010 16:51:17 +0000 (09:51 -0700)
It's important to cast to hrtime_t before doing the multiply because
the ts.tv_sec type is only 32-bits and we need to promote it to 64-bits.

module/spl/spl-time.c

index 4c08b754dd1c01d05f4f4b69737deacd69edccdf..6ef9b8fc8e1dbcfd0956380d909d01a4c4415719 100644 (file)
@@ -63,7 +63,7 @@ __gethrtime(void) {
         struct timespec ts;
 
         do_posix_clock_monotonic_gettime(&ts);
-        return (hrtime_t)((ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec);
+        return (((hrtime_t)ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec);
 #endif
 }
 EXPORT_SYMBOL(__gethrtime);