summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2019-07-12 17:34:55 -0700
committerJordan Justen <jordan.l.justen@intel.com>2019-07-14 01:12:31 -0700
commit70565e64227dfa254d8a0703dd60dc74bd8b5e6e (patch)
treefde3ed55d793270e58db9e42c8d23300d8069fa8 /EmulatorPkg
parent8f5b265500bd10ae74f814d46184857711cab45b (diff)
downloadedk2-70565e64227dfa254d8a0703dd60dc74bd8b5e6e.tar.gz
edk2-70565e64227dfa254d8a0703dd60dc74bd8b5e6e.tar.bz2
edk2-70565e64227dfa254d8a0703dd60dc74bd8b5e6e.zip
EmulatorPkg/Unix: Convert timezone from seconds to minutes
Fixes and assert seen when running ls under the shell. It appears the assert was added in: commit 99849a906e15ea3a9a0330d69bbae0d21ff49808 ShellPkg/ls: Display the file time in local time. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'EmulatorPkg')
-rw-r--r--EmulatorPkg/Unix/Host/EmuThunk.c4
-rw-r--r--EmulatorPkg/Unix/Host/PosixFileSystem.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/EmulatorPkg/Unix/Host/EmuThunk.c b/EmulatorPkg/Unix/Host/EmuThunk.c
index f1330c8234..1c261a63cc 100644
--- a/EmulatorPkg/Unix/Host/EmuThunk.c
+++ b/EmulatorPkg/Unix/Host/EmuThunk.c
@@ -9,7 +9,7 @@
it may cause the table to be initaliized with the members at the end being
set to zero. This is bad as jumping to zero will crash.
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -363,7 +363,7 @@ SecGetTime (
Time->Minute = tm->tm_min;
Time->Second = tm->tm_sec;
Time->Nanosecond = 0;
- Time->TimeZone = timezone;
+ Time->TimeZone = timezone / 60;
Time->Daylight = (daylight ? EFI_TIME_ADJUST_DAYLIGHT : 0)
| (tm->tm_isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0);
diff --git a/EmulatorPkg/Unix/Host/PosixFileSystem.c b/EmulatorPkg/Unix/Host/PosixFileSystem.c
index 3149c6c3e0..6ba3b59d7a 100644
--- a/EmulatorPkg/Unix/Host/PosixFileSystem.c
+++ b/EmulatorPkg/Unix/Host/PosixFileSystem.c
@@ -2,6 +2,7 @@
POSIX Pthreads to emulate APs and implement threads
Copyright (c) 2011, Apple Inc. All rights reserved.
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -220,7 +221,7 @@ PosixSystemTimeToEfiTime (
Time->Second = tm->tm_sec;
Time->Nanosecond = 0;
- Time->TimeZone = timezone;
+ Time->TimeZone = timezone / 60;
Time->Daylight = (daylight ? EFI_TIME_ADJUST_DAYLIGHT : 0) | (tm->tm_isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0);
}