mirror of https://github.com/acidanthera/audk.git
Please find this patch that makes FatGetCurrentFatTime() always return a valid time. Without this patch if gRT->GetTime fails to return the time then some operations on the filesystem could fail.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> (based on FatPkg commit c9429aef66663a27642bdaa3685e8a86f7bc74c7) [jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Leif Lindholm <leif.lindholm@arm.com>
This commit is contained in:
parent
4a30cd67a5
commit
ab99061ccc
|
@ -342,9 +342,19 @@ Returns:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_TIME Now;
|
EFI_STATUS Status;
|
||||||
gRT->GetTime (&Now, NULL);
|
EFI_TIME Now;
|
||||||
FatEfiTimeToFatTime (&Now, FatNow);
|
|
||||||
|
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
|
BOOLEAN
|
||||||
|
|
Loading…
Reference in New Issue