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 99849a906e

    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>
This commit is contained in:
Jordan Justen 2019-07-12 17:34:55 -07:00
parent 8f5b265500
commit 70565e6422
No known key found for this signature in database
GPG Key ID: 37F99F68CAF992EB
2 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -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);
}