From: "Marvin Häuser" <Marvin.Haeuser@outlook.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "vit9696@protonmail.com" <vit9696@protonmail.com>,
Ray Ni <ray.ni@intel.com>, Zhichao Gao <zhichao.gao@intel.com>
Subject: [PATCH] ShellPkg/Ls: Consider UEFI timezone may not be set
Date: Sun, 20 Oct 2019 12:08:32 +0000 [thread overview]
Message-ID: <DB7PR07MB4917F4117C73A3ECEE57F5E4806E0@DB7PR07MB4917.eurprd07.prod.outlook.com> (raw)
In-Reply-To: <aa5718fc4fdc610f03912cfcfd6fd8760d866117.1571572996.git.mhaeuser@outlook.de>
From: Marvin Haeuser <mhaeuser@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@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Marvin Haeuser <mhaeuser@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
next parent reply other threads:[~2019-10-20 12:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <aa5718fc4fdc610f03912cfcfd6fd8760d866117.1571572996.git.mhaeuser@outlook.de>
2019-10-20 12:08 ` Marvin Häuser [this message]
2019-10-24 1:19 ` [PATCH] ShellPkg/Ls: Consider UEFI timezone may not be set Gao, Zhichao
2019-10-20 12:08 ` [PATCH] MdePkg/UefiFileHandleLib: Tolerate more Root handle FileNames Marvin Häuser
2019-10-24 2:51 ` Gao, Zhichao
2019-11-04 0:50 ` Liming Gao
[not found] ` <15D3CF493CDD3994.15406@groups.io>
2019-11-04 2:07 ` [edk2-devel] " Liming Gao
2019-10-20 12:08 ` [PATCH] ShellPkg/Ls: Return empty content for all empty folders Marvin Häuser
2019-11-01 0:39 ` Gao, Zhichao
2019-10-20 12:08 ` [PATCH] UefiShellCommandLib: Default to first found UC for unsupported PlatformLang Marvin Häuser
2019-10-24 1:24 ` Gao, Zhichao
2019-11-05 3:03 ` Ni, Ray
2019-11-05 4:52 ` Gao, Zhichao
2019-11-05 6:41 ` Gao, Zhichao
2019-10-20 12:08 ` [PATCH] MdePkg/UefiDebugLibConOut: Pass the correct buffer size Marvin Häuser
2019-10-21 3:11 ` Liming Gao
[not found] ` <15CF8AE415F70486.7044@groups.io>
2019-11-04 2:11 ` [edk2-devel] " Liming Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB7PR07MB4917F4117C73A3ECEE57F5E4806E0@DB7PR07MB4917.eurprd07.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox