From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: jordan.l.justen@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Sat, 13 Jul 2019 01:08:34 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jul 2019 01:08:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,485,1557212400"; d="scan'208";a="166880178" Received: from abaradwa-mobl.amr.corp.intel.com (HELO jljusten-skl.amr.corp.intel.com) ([10.254.104.4]) by fmsmga008.fm.intel.com with ESMTP; 13 Jul 2019 01:08:33 -0700 From: "Jordan Justen" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni Subject: [PATCH] EmulatorPkg/Unix: Convert timezone from seconds to minutes Date: Sat, 13 Jul 2019 01:08:13 -0700 Message-Id: <20190713080813.9869-1-jordan.l.justen@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Andrew Fish Cc: Ray Ni --- 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