[edk2-devel] [PATCH] ShellPkg/Ls: Consider UEFI timezone may not be set

Gao, Zhichao zhichao.gao at intel.com
Thu Oct 24 01:19:02 UTC 2019


Reviewed-by: Zhichao Gao <zhichao.gao at intel.com>

> -----Original Message-----
> From: Marvin Häuser [mailto:Marvin.Haeuser at outlook.com]
> Sent: Sunday, October 20, 2019 8:09 PM
> To: devel at edk2.groups.io
> Cc: vit9696 at protonmail.com; Ni, Ray <ray.ni at intel.com>; Gao, Zhichao
> <zhichao.gao at intel.com>
> Subject: [PATCH] ShellPkg/Ls: Consider UEFI timezone may not be set
> 
> From: Marvin Haeuser <mhaeuser at outlook.de>
> 
> 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 at intel.com>
> Cc: Zhichao Gao <zhichao.gao at intel.com>
> Signed-off-by: Marvin Haeuser <mhaeuser at outlook.de>
> ---
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> index adeb987e6ecb..1a65f60c3b44 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))
> {           //--
> 2.23.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49409): https://edk2.groups.io/g/devel/message/49409
Mute This Topic: https://groups.io/mt/35954829/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list