projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6ec0dcd
)
Fix overflow caused by signed long division by unsigned long.
author
YukiKita
<kita.yuki@gmail.com>
Fri, 29 Jul 2016 00:25:17 +0000
(09:25 +0900)
committer
YukiKita
<kita.yuki@gmail.com>
Fri, 29 Jul 2016 00:25:17 +0000
(09:25 +0900)
The over flow seems to occurr when the value of 'log_avg_msec' option is relatively large.
gettime.c
patch
|
blob
|
blame
|
history
diff --git
a/gettime.c
b/gettime.c
index b896b5bd9923e7b818e9e88fe99eb0a369dd9f63..964a52fa237afe50a05cd7d9081c3e29c26c70fc 100644
(file)
--- a/
gettime.c
+++ b/
gettime.c
@@
-424,8
+424,8
@@
uint64_t mtime_since(const struct timeval *s, const struct timeval *e)
if (sec < 0 || (sec == 0 && usec < 0))
return 0;
if (sec < 0 || (sec == 0 && usec < 0))
return 0;
- sec *= 1000
UL
;
- usec /= 1000
UL
;
+ sec *= 1000;
+ usec /= 1000;
ret = sec + usec;
return ret;
ret = sec + usec;
return ret;