mirror of https://github.com/acidanthera/audk.git
Remove ASSERT within Ls for RTC error and associated changes.
TimeDate.c: replace magic number with constant. Ls.c: use new warning printout string and remove an ASSERT. also replace magic number with constant. The UNI file: add new warning printout string. Signed-off-by: jcarsey Reviewed-by: geekboy15a Reviewed-by: lgrosenb git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11703 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
9fd2164e34
commit
2e8e9ed5ed
|
@ -538,7 +538,11 @@ ShellCommandRunLs (
|
||||||
StrnCatGrow(&FullPath, NULL, L"*", 0);
|
StrnCatGrow(&FullPath, NULL, L"*", 0);
|
||||||
}
|
}
|
||||||
Status = gRT->GetTime(&TheTime, NULL);
|
Status = gRT->GetTime(&TheTime, NULL);
|
||||||
ASSERT_EFI_ERROR(Status);
|
if (EFI_ERROR(Status)) {
|
||||||
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_UEFI_FUNC_WARN), gShellLevel2HiiHandle, L"gRT->GetTime", Status);
|
||||||
|
TheTime.TimeZone = EFI_UNSPECIFIED_TIMEZONE;
|
||||||
|
}
|
||||||
|
|
||||||
SfoMode = ShellCommandLineGetFlag(Package, L"-sfo");
|
SfoMode = ShellCommandLineGetFlag(Package, L"-sfo");
|
||||||
if (ShellStatus == SHELL_SUCCESS) {
|
if (ShellStatus == SHELL_SUCCESS) {
|
||||||
ShellStatus = PrintLsOutput(
|
ShellStatus = PrintLsOutput(
|
||||||
|
@ -548,7 +552,7 @@ ShellCommandRunLs (
|
||||||
FullPath,
|
FullPath,
|
||||||
TRUE,
|
TRUE,
|
||||||
Count,
|
Count,
|
||||||
(INT16)(TheTime.TimeZone==2047?0:TheTime.TimeZone)
|
(INT16)(TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:TheTime.TimeZone)
|
||||||
);
|
);
|
||||||
if (ShellStatus == SHELL_NOT_FOUND) {
|
if (ShellStatus == SHELL_NOT_FOUND) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_FILES), gShellLevel2HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_FILES), gShellLevel2HiiHandle);
|
||||||
|
|
|
@ -430,7 +430,7 @@ ShellCommandRunTime (
|
||||||
//
|
//
|
||||||
// ShellPrintEx the current time
|
// ShellPrintEx the current time
|
||||||
//
|
//
|
||||||
if (TheTime.TimeZone == 2047) {
|
if (TheTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) {
|
||||||
TzMinutes = 0;
|
TzMinutes = 0;
|
||||||
} else {
|
} else {
|
||||||
TzMinutes = (ABS(TheTime.TimeZone)) % 60;
|
TzMinutes = (ABS(TheTime.TimeZone)) % 60;
|
||||||
|
@ -445,13 +445,13 @@ ShellCommandRunTime (
|
||||||
TheTime.Hour,
|
TheTime.Hour,
|
||||||
TheTime.Minute,
|
TheTime.Minute,
|
||||||
TheTime.Second,
|
TheTime.Second,
|
||||||
TheTime.TimeZone==2047?L" ":(TheTime.TimeZone > 0?L"-":L"+"),
|
TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?L" ":(TheTime.TimeZone > 0?L"-":L"+"),
|
||||||
TheTime.TimeZone==2047?0:(ABS(TheTime.TimeZone)) / 60,
|
TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(ABS(TheTime.TimeZone)) / 60,
|
||||||
TzMinutes
|
TzMinutes
|
||||||
);
|
);
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CRLF), gShellLevel2HiiHandle);
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CRLF), gShellLevel2HiiHandle);
|
||||||
} else if (ShellCommandLineGetFlag(Package, L"-d") && ShellCommandLineGetValue(Package, L"-d") == NULL) {
|
} else if (ShellCommandLineGetFlag(Package, L"-d") && ShellCommandLineGetValue(Package, L"-d") == NULL) {
|
||||||
if (TheTime.TimeZone == 2047) {
|
if (TheTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) {
|
||||||
TzMinutes = 0;
|
TzMinutes = 0;
|
||||||
} else {
|
} else {
|
||||||
TzMinutes = (ABS(TheTime.TimeZone)) % 60;
|
TzMinutes = (ABS(TheTime.TimeZone)) % 60;
|
||||||
|
@ -466,8 +466,8 @@ ShellCommandRunTime (
|
||||||
TheTime.Hour,
|
TheTime.Hour,
|
||||||
TheTime.Minute,
|
TheTime.Minute,
|
||||||
TheTime.Second,
|
TheTime.Second,
|
||||||
TheTime.TimeZone==2047?L" ":(TheTime.TimeZone > 0?L"-":L"+"),
|
TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?L" ":(TheTime.TimeZone > 0?L"-":L"+"),
|
||||||
TheTime.TimeZone==2047?0:(ABS(TheTime.TimeZone)) / 60,
|
TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(ABS(TheTime.TimeZone)) / 60,
|
||||||
TzMinutes
|
TzMinutes
|
||||||
);
|
);
|
||||||
switch (TheTime.Daylight) {
|
switch (TheTime.Daylight) {
|
||||||
|
@ -500,7 +500,7 @@ ShellCommandRunTime (
|
||||||
} else {
|
} else {
|
||||||
Tz = (INT16)ShellStrToUintn(TempLocation);
|
Tz = (INT16)ShellStrToUintn(TempLocation);
|
||||||
}
|
}
|
||||||
if (!(Tz >= -1440 && Tz <= 1440) && Tz != 2047) {
|
if (!(Tz >= -1440 && Tz <= 1440) && Tz != EFI_UNSPECIFIED_TIMEZONE) {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"-tz");
|
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellLevel2HiiHandle, L"-tz");
|
||||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
@ -776,7 +776,7 @@ ShellCommandRunTimeZone (
|
||||||
Status = gRT->GetTime(&TheTime, NULL);
|
Status = gRT->GetTime(&TheTime, NULL);
|
||||||
ASSERT_EFI_ERROR(Status);
|
ASSERT_EFI_ERROR(Status);
|
||||||
|
|
||||||
if (TheTime.TimeZone != 2047) {
|
if (TheTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) {
|
||||||
Found = FALSE;
|
Found = FALSE;
|
||||||
for ( LoopVar = 0
|
for ( LoopVar = 0
|
||||||
; LoopVar < sizeof(TimeZoneList) / sizeof(TimeZoneList[0])
|
; LoopVar < sizeof(TimeZoneList) / sizeof(TimeZoneList[0])
|
||||||
|
@ -792,7 +792,7 @@ ShellCommandRunTimeZone (
|
||||||
//
|
//
|
||||||
// Print basic info only
|
// Print basic info only
|
||||||
//
|
//
|
||||||
if (TheTime.TimeZone == 2047) {
|
if (TheTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) {
|
||||||
TzMinutes = 0;
|
TzMinutes = 0;
|
||||||
} else {
|
} else {
|
||||||
TzMinutes = (ABS(TheTime.TimeZone)) % 60;
|
TzMinutes = (ABS(TheTime.TimeZone)) % 60;
|
||||||
|
@ -804,8 +804,8 @@ ShellCommandRunTimeZone (
|
||||||
NULL,
|
NULL,
|
||||||
STRING_TOKEN(STR_TIMEZONE_SIMPLE),
|
STRING_TOKEN(STR_TIMEZONE_SIMPLE),
|
||||||
gShellLevel2HiiHandle,
|
gShellLevel2HiiHandle,
|
||||||
TheTime.TimeZone==2047?0:(TheTime.TimeZone > 0?L"-":L"+"),
|
TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(TheTime.TimeZone > 0?L"-":L"+"),
|
||||||
TheTime.TimeZone==2047?0:(ABS(TheTime.TimeZone)) / 60,
|
TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(ABS(TheTime.TimeZone)) / 60,
|
||||||
TzMinutes);
|
TzMinutes);
|
||||||
}
|
}
|
||||||
Found = TRUE;
|
Found = TRUE;
|
||||||
|
@ -816,7 +816,7 @@ ShellCommandRunTimeZone (
|
||||||
//
|
//
|
||||||
// Print basic info only
|
// Print basic info only
|
||||||
//
|
//
|
||||||
if (TheTime.TimeZone == 2047) {
|
if (TheTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) {
|
||||||
TzMinutes = 0;
|
TzMinutes = 0;
|
||||||
} else {
|
} else {
|
||||||
TzMinutes = (ABS(TheTime.TimeZone)) % 60;
|
TzMinutes = (ABS(TheTime.TimeZone)) % 60;
|
||||||
|
@ -827,8 +827,8 @@ ShellCommandRunTimeZone (
|
||||||
NULL,
|
NULL,
|
||||||
STRING_TOKEN(STR_TIMEZONE_SIMPLE),
|
STRING_TOKEN(STR_TIMEZONE_SIMPLE),
|
||||||
gShellLevel2HiiHandle,
|
gShellLevel2HiiHandle,
|
||||||
TheTime.TimeZone==2047?0:(TheTime.TimeZone > 0?L"-":L"+"),
|
TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(TheTime.TimeZone > 0?L"-":L"+"),
|
||||||
TheTime.TimeZone==2047?0:(ABS(TheTime.TimeZone)) / 60,
|
TheTime.TimeZone==EFI_UNSPECIFIED_TIMEZONE?0:(ABS(TheTime.TimeZone)) / 60,
|
||||||
TzMinutes);
|
TzMinutes);
|
||||||
if (ShellCommandLineGetFlag(Package, L"-f")) {
|
if (ShellCommandLineGetFlag(Package, L"-f")) {
|
||||||
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN(STR_TIMEZONE_NI), gShellLevel2HiiHandle);
|
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN(STR_TIMEZONE_NI), gShellLevel2HiiHandle);
|
||||||
|
@ -836,7 +836,7 @@ ShellCommandRunTimeZone (
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// TimeZone was 2047 (unknown) from GetTime()
|
// TimeZone was EFI_UNSPECIFIED_TIMEZONE (unknown) from GetTime()
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue