]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg/Unix: Convert timezone from seconds to minutes
authorJordan Justen <jordan.l.justen@intel.com>
Sat, 13 Jul 2019 00:34:55 +0000 (17:34 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 14 Jul 2019 08:12:31 +0000 (01:12 -0700)
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>
EmulatorPkg/Unix/Host/EmuThunk.c
EmulatorPkg/Unix/Host/PosixFileSystem.c

index f1330c82348f5c612a1ec8b81a823f03bb7b4ed6..1c261a63cc4800d1a0ad35b475656660b2e68056 100644 (file)
@@ -9,7 +9,7 @@
   it may cause the table to be initaliized with the members at the end being\r
   set to zero. This is bad as jumping to zero will crash.\r
 \r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>\r
 Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -363,7 +363,7 @@ SecGetTime (
   Time->Minute = tm->tm_min;\r
   Time->Second = tm->tm_sec;\r
   Time->Nanosecond = 0;\r
-  Time->TimeZone = timezone;\r
+  Time->TimeZone = timezone / 60;\r
   Time->Daylight = (daylight ? EFI_TIME_ADJUST_DAYLIGHT : 0)\r
     | (tm->tm_isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0);\r
 \r
index 3149c6c3e077bfd01ca82bad4a2ba5280c178ea2..6ba3b59d7a5b8e5ce67cb34433cfb3818f97ad3d 100644 (file)
@@ -2,6 +2,7 @@
  POSIX Pthreads to emulate APs and implement threads\r
 \r
 Copyright (c) 2011, Apple Inc. All rights reserved.\r
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 \r
@@ -220,7 +221,7 @@ PosixSystemTimeToEfiTime (
   Time->Second = tm->tm_sec;\r
   Time->Nanosecond = 0;\r
 \r
-  Time->TimeZone = timezone;\r
+  Time->TimeZone = timezone / 60;\r
   Time->Daylight = (daylight ? EFI_TIME_ADJUST_DAYLIGHT : 0) | (tm->tm_isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0);\r
 }\r
 \r