summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorMarvin Haeuser <mhaeuser@outlook.de>2019-10-20 20:08:32 +0800
committerLiming Gao <liming.gao@intel.com>2019-11-04 10:46:02 +0800
commit106369fe26579c2c97131c3dd9e7c7332a5ec575 (patch)
tree4045572f96ef5af4161a4368b6d8755599280b23 /ShellPkg
parent17efd446c00b414ddeb53ec00b85d780f2f09250 (diff)
downloadedk2-106369fe26579c2c97131c3dd9e7c7332a5ec575.tar.gz
edk2-106369fe26579c2c97131c3dd9e7c7332a5ec575.tar.bz2
edk2-106369fe26579c2c97131c3dd9e7c7332a5ec575.zip
ShellPkg/Ls: Consider UEFI timezone may not be set
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2294 EFI_RUNTIME_SERVICES.GetTime() might return an unspecified Timezone, such as when SetTime() has not been called after the RTC was cut off power. Consider this case by not attempting Timezone translations for when it is invalid. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
index adeb987e6e..1a65f60c3b 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
@@ -500,7 +500,7 @@ PrintLsOutput(
// Change the file time to local time.
//
Status = gRT->GetTime(&LocalTime, NULL);
- if (!EFI_ERROR (Status)) {
+ if (!EFI_ERROR (Status) && (LocalTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE)) {
if ((Node->Info->CreateTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) &&
(Node->Info->CreateTime.Month >= 1 && Node->Info->CreateTime.Month <= 12)) {
//