[edk2-devel] [PATCH] EmulatorPkg/Unix: Convert timezone from seconds to minutes

Jordan Justen posted 1 patch 4 years, 9 months ago
Failed in applying to current master (apply log)
EmulatorPkg/Unix/Host/EmuThunk.c        | 2 +-
EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[edk2-devel] [PATCH] EmulatorPkg/Unix: Convert timezone from seconds to minutes
Posted by Jordan Justen 4 years, 9 months ago
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>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
---

 For reference: https://linux.die.net/man/3/timezone

 EmulatorPkg/Unix/Host/EmuThunk.c        | 2 +-
 EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/EmulatorPkg/Unix/Host/EmuThunk.c b/EmulatorPkg/Unix/Host/EmuThunk.c
index f1330c8234..665477e223 100644
--- a/EmulatorPkg/Unix/Host/EmuThunk.c
+++ b/EmulatorPkg/Unix/Host/EmuThunk.c
@@ -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..5b74053498 100644
--- a/EmulatorPkg/Unix/Host/PosixFileSystem.c
+++ b/EmulatorPkg/Unix/Host/PosixFileSystem.c
@@ -220,7 +220,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);
 }
 
-- 
2.22.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43695): https://edk2.groups.io/g/devel/message/43695
Mute This Topic: https://groups.io/mt/32457224/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH] EmulatorPkg/Unix: Convert timezone from seconds to minutes
Posted by Ni, Ray 4 years, 9 months ago
Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Justen, Jordan L
> Sent: Saturday, July 13, 2019 4:08 PM
> To: devel@edk2.groups.io
> Cc: Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish <afish@apple.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH] 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>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
> 
>  For reference: https://linux.die.net/man/3/timezone
> 
>  EmulatorPkg/Unix/Host/EmuThunk.c        | 2 +-
>  EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/EmulatorPkg/Unix/Host/EmuThunk.c b/EmulatorPkg/Unix/Host/EmuThunk.c
> index f1330c8234..665477e223 100644
> --- a/EmulatorPkg/Unix/Host/EmuThunk.c
> +++ b/EmulatorPkg/Unix/Host/EmuThunk.c
> @@ -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..5b74053498 100644
> --- a/EmulatorPkg/Unix/Host/PosixFileSystem.c
> +++ b/EmulatorPkg/Unix/Host/PosixFileSystem.c
> @@ -220,7 +220,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);
>  }
> 
> --
> 2.22.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43697): https://edk2.groups.io/g/devel/message/43697
Mute This Topic: https://groups.io/mt/32457224/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-