summaryrefslogtreecommitdiffstats
path: root/FatPkg
diff options
context:
space:
mode:
Diffstat (limited to 'FatPkg')
-rw-r--r--FatPkg/EnhancedFatDxe/Misc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/FatPkg/EnhancedFatDxe/Misc.c b/FatPkg/EnhancedFatDxe/Misc.c
index b62c4c54ae..9a8f3cab4f 100644
--- a/FatPkg/EnhancedFatDxe/Misc.c
+++ b/FatPkg/EnhancedFatDxe/Misc.c
@@ -342,9 +342,19 @@ Returns:
--*/
{
- EFI_TIME Now;
- gRT->GetTime (&Now, NULL);
- FatEfiTimeToFatTime (&Now, FatNow);
+ EFI_STATUS Status;
+ EFI_TIME Now;
+
+ Status = gRT->GetTime (&Now, NULL);
+ if (!EFI_ERROR (Status)) {
+ FatEfiTimeToFatTime (&Now, FatNow);
+ } else {
+ ZeroMem (&Now, sizeof (EFI_TIME));
+ Now.Year = 1980;
+ Now.Month = 1;
+ Now.Day = 1;
+ FatEfiTimeToFatTime (&Now, FatNow);
+ }
}
BOOLEAN