lib/time: EFI: Return time of 0 if GetTime() unsupported
This commit is contained in:
parent
2bba72634f
commit
e49865a467
@ -63,7 +63,11 @@ again:
|
|||||||
#if defined (UEFI)
|
#if defined (UEFI)
|
||||||
uint64_t time(void) {
|
uint64_t time(void) {
|
||||||
EFI_TIME time;
|
EFI_TIME time;
|
||||||
gRT->GetTime(&time, NULL);
|
EFI_STATUS status = gRT->GetTime(&time, NULL);
|
||||||
|
|
||||||
|
if (status != 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return get_unix_epoch(time.Second, time.Minute, time.Hour,
|
return get_unix_epoch(time.Second, time.Minute, time.Hour,
|
||||||
time.Day, time.Month, time.Year);
|
time.Day, time.Month, time.Year);
|
||||||
|
Loading…
Reference in New Issue
Block a user