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.115, mailfrom: ray.ni@intel.com) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Sat, 13 Jul 2019 04:13:12 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jul 2019 04:13:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,486,1557212400"; d="scan'208";a="190088143" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 13 Jul 2019 04:13:11 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 13 Jul 2019 04:13:11 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sat, 13 Jul 2019 04:13:11 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sat, 13 Jul 2019 04:13:10 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.110]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.240]) with mapi id 14.03.0439.000; Sat, 13 Jul 2019 19:13:09 +0800 From: "Ni, Ray" To: "Justen, Jordan L" , "devel@edk2.groups.io" CC: Andrew Fish Subject: Re: [PATCH] EmulatorPkg/Unix: Convert timezone from seconds to minutes Thread-Topic: [PATCH] EmulatorPkg/Unix: Convert timezone from seconds to minutes Thread-Index: AQHVOVIshGUczDPE2U+bvDDDyPW8K6bIZRsw Date: Sat, 13 Jul 2019 11:13:09 +0000 Deferred-Delivery: Sat, 13 Jul 2019 11:13:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C229CC4@SHSMSX104.ccr.corp.intel.com> References: <20190713080813.9869-1-jordan.l.justen@intel.com> In-Reply-To: <20190713080813.9869-1-jordan.l.justen@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzlmMGQ3MjItYjA5YS00NmZjLTk0YjgtOTAyM2I0NDU5Y2MyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibVZGY2xTNDdnN1N6RXRPZEdsWENUNFJqUm54Yk5Ra0ZcL053QXpIU0dlK25lVGJBemNZT1dzZEVUQnJld2lGdDIifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Justen, Jordan L > Sent: Saturday, July 13, 2019 4:08 PM > To: devel@edk2.groups.io > Cc: Justen, Jordan L ; Andrew Fish ; Ni, Ray > Subject: [PATCH] EmulatorPkg/Unix: Convert timezone from seconds to minut= es >=20 > Fixes and assert seen when running ls under the shell. It appears the > assert was added in: >=20 > commit 99849a906e15ea3a9a0330d69bbae0d21ff49808 >=20 > ShellPkg/ls: Display the file time in local time. >=20 > Signed-off-by: Jordan Justen > Cc: Andrew Fish > Cc: Ray Ni > --- >=20 > For reference: https://linux.die.net/man/3/timezone >=20 > EmulatorPkg/Unix/Host/EmuThunk.c | 2 +- > EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/EmulatorPkg/Unix/Host/EmuThunk.c b/EmulatorPkg/Unix/Host/Emu= Thunk.c > index f1330c8234..665477e223 100644 > --- a/EmulatorPkg/Unix/Host/EmuThunk.c > +++ b/EmulatorPkg/Unix/Host/EmuThunk.c > @@ -363,7 +363,7 @@ SecGetTime ( > Time->Minute =3D tm->tm_min; > Time->Second =3D tm->tm_sec; > Time->Nanosecond =3D 0; > - Time->TimeZone =3D timezone; > + Time->TimeZone =3D timezone / 60; > Time->Daylight =3D (daylight ? EFI_TIME_ADJUST_DAYLIGHT : 0) > | (tm->tm_isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0); >=20 > diff --git a/EmulatorPkg/Unix/Host/PosixFileSystem.c b/EmulatorPkg/Unix/H= ost/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 =3D tm->tm_sec; > Time->Nanosecond =3D 0; >=20 > - Time->TimeZone =3D timezone; > + Time->TimeZone =3D timezone / 60; > Time->Daylight =3D (daylight ? EFI_TIME_ADJUST_DAYLIGHT : 0) | (tm->tm= _isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0); > } >=20 > -- > 2.22.0