|
@@ -218,9 +218,10 @@ efi_gettimeofday (struct timespec *ts)
|
|
|
{
|
|
|
efi_time_t tm;
|
|
|
|
|
|
- memset(ts, 0, sizeof(ts));
|
|
|
- if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS)
|
|
|
+ if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS) {
|
|
|
+ memset(ts, 0, sizeof(*ts));
|
|
|
return;
|
|
|
+ }
|
|
|
|
|
|
ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second);
|
|
|
ts->tv_nsec = tm.nanosecond;
|