Chromium Code Reviews| Index: base/time_posix.cc |
| diff --git a/base/time_posix.cc b/base/time_posix.cc |
| index c79781c3cf58d07c3d7ed4a6fc6094d59fae4fe2..de8f6ea383c2beeb061f54ca1e04c38e149ff641 100644 |
| --- a/base/time_posix.cc |
| +++ b/base/time_posix.cc |
| @@ -70,6 +70,10 @@ Time Time::Now() { |
| struct timezone tz = { 0, 0 }; // UTC |
| if (gettimeofday(&tv, &tz) != 0) { |
| DCHECK(0) << "Could not determine time of day"; |
| + LOG_ERRNO(ERROR) << "Call to gettimeofday failed."; |
| + // Return zero instead of uninitialized |tv| value, which contains random |
| + // garbage data. This may result in the crash seen in crbug.com/147570. |
| + return Time(0L); |
|
brettw
2012/09/11 18:10:23
Use return Time();
jennyz
2012/09/11 18:35:22
Done.
|
| } |
| // Combine seconds and microseconds in a 64-bit field containing microseconds |
| // since the epoch. That's enough for nearly 600 centuries. Adjust from |