From 70565e64227dfa254d8a0703dd60dc74bd8b5e6e Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Fri, 12 Jul 2019 17:34:55 -0700 Subject: 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 Reviewed-by: Ray Ni --- EmulatorPkg/Unix/Host/EmuThunk.c | 4 ++-- EmulatorPkg/Unix/Host/PosixFileSystem.c | 3 ++- 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.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
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.
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); } -- cgit v1.2.3