mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Don't throw needlessly. Failure of gettimeofday is *very* unlinkely so
just return MinTime if that should ever happen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29826 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a2b7c91cb
commit
d8509c95b8
@ -39,8 +39,13 @@ std::string TimeValue::toString() const {
|
|||||||
TimeValue TimeValue::now() {
|
TimeValue TimeValue::now() {
|
||||||
struct timeval the_time;
|
struct timeval the_time;
|
||||||
timerclear(&the_time);
|
timerclear(&the_time);
|
||||||
if (0 != ::gettimeofday(&the_time,0))
|
if (0 != ::gettimeofday(&the_time,0)) {
|
||||||
ThrowErrno("Couldn't obtain time of day");
|
// This is *really* unlikely to occur because the only gettimeofday
|
||||||
|
// errors concern the timezone parameter which we're passing in as 0.
|
||||||
|
// In the unlikely case it does happen, just return MinTime, no error
|
||||||
|
// message needed.
|
||||||
|
return MinTime;
|
||||||
|
}
|
||||||
|
|
||||||
return TimeValue(
|
return TimeValue(
|
||||||
static_cast<TimeValue::SecondsType>( the_time.tv_sec ),
|
static_cast<TimeValue::SecondsType>( the_time.tv_sec ),
|
||||||
|
Loading…
Reference in New Issue
Block a user