Skip to content

Commit

Permalink
linux:SystemTimeSupport: make compatible with time64 (64-bit time_t) (#…
Browse files Browse the repository at this point in the history
…19985)

* platform:linux:SystemTimeSupport: make compatible with time64 (64-bit time_t, as in musl)

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
plan44 and restyled-commits authored Jun 27, 2022
1 parent 7600179 commit 6efefe3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/platform/Linux/SystemTimeSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ CHIP_ERROR ClockImpl::SetClock_RealTime(Microseconds64 aNewCurTime)
const time_t timep = tv.tv_sec;
struct tm calendar;
localtime_r(&timep, &calendar);
ChipLogProgress(DeviceLayer, "Real time clock set to %ld (%04d/%02d/%02d %02d:%02d:%02d UTC)", tv.tv_sec, calendar.tm_year,
calendar.tm_mon, calendar.tm_mday, calendar.tm_hour, calendar.tm_min, calendar.tm_sec);
ChipLogProgress(DeviceLayer, "Real time clock set to %lld (%04d/%02d/%02d %02d:%02d:%02d UTC)",
static_cast<long long>(tv.tv_sec), calendar.tm_year, calendar.tm_mon, calendar.tm_mday, calendar.tm_hour,
calendar.tm_min, calendar.tm_sec);
}
#endif // CHIP_PROGRESS_LOGGING
return CHIP_NO_ERROR;
Expand Down

0 comments on commit 6efefe3

Please sign in to comment.