summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Narayan Kamath <narayan@google.com> 2015-12-03 14:11:46 +0000
committer Narayan Kamath <narayan@google.com> 2015-12-30 13:09:23 +0000
commit93e8edd3b35637b9abd450e0733bc1a653c700aa (patch)
tree455eab69e59fe258a37d49f71f0e0bab242be677
parentb4a20a9e51b4b523b1f50e4401af38c53cdc161b (diff)
Fix bogus logging statement.
We were always logging an empty string. Change-Id: I9ebc89ce2df8cb664aaf2640a16dcd85bdfa036e
-rw-r--r--runtime/base/time_utils.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/runtime/base/time_utils.cc b/runtime/base/time_utils.cc
index 48b0a090ce..b7cf2072dc 100644
--- a/runtime/base/time_utils.cc
+++ b/runtime/base/time_utils.cc
@@ -174,8 +174,6 @@ void NanoSleep(uint64_t ns) {
}
void InitTimeSpec(bool absolute, int clock, int64_t ms, int32_t ns, timespec* ts) {
- int64_t endSec;
-
if (absolute) {
#if !defined(__APPLE__)
clock_gettime(clock, ts);
@@ -190,13 +188,13 @@ void InitTimeSpec(bool absolute, int clock, int64_t ms, int32_t ns, timespec* ts
ts->tv_sec = 0;
ts->tv_nsec = 0;
}
- endSec = ts->tv_sec + ms / 1000;
- if (UNLIKELY(endSec >= 0x7fffffff)) {
- std::ostringstream ss;
- LOG(INFO) << "Note: end time exceeds epoch: " << ss.str();
- endSec = 0x7ffffffe;
+
+ int64_t end_sec = ts->tv_sec + ms / 1000;
+ if (UNLIKELY(end_sec >= 0x7fffffff)) {
+ LOG(INFO) << "Note: end time exceeds INT32_MAX: " << end_sec;
+ end_sec = 0x7ffffffe;
}
- ts->tv_sec = endSec;
+ ts->tv_sec = end_sec;
ts->tv_nsec = (ts->tv_nsec + (ms % 1000) * 1000000) + ns;
// Catch rollover.