From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.emacs.devel Subject: Re: boot-time: straighten code Date: Mon, 14 Aug 2023 07:44:36 +0800 Message-ID: References: <4536176.VaOIPsP7d9@nimes> <5a77c0b9-8692-83bf-1aca-2f1d27122877@cs.ucla.edu> <87v8djoc6n.fsf@yahoo.com> <3909139.bdzUSs2D5r@nimes> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="599"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Paul Eggert , bug-gnulib@gnu.org, Emacs-devel@gnu.org To: Bruno Haible Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Mon Aug 14 01:45:13 2023 Return-path: Envelope-to: gnu-bug-gnulib@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qVKlk-000AV7-PW for gnu-bug-gnulib@m.gmane-mx.org; Mon, 14 Aug 2023 01:45:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVKlY-0004rm-A8; Sun, 13 Aug 2023 19:45:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVKlV-0004rO-67 for bug-gnulib@gnu.org; Sun, 13 Aug 2023 19:44:57 -0400 Original-Received: from sonic301-32.consmr.mail.ne1.yahoo.com ([66.163.184.201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVKlS-0007iU-UL for bug-gnulib@gnu.org; Sun, 13 Aug 2023 19:44:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1691970291; bh=cXcc3tis2U11B4OMKIcSaDw/ylSt3oBFlIjWvcOOyAY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=BqBKMNx5Ea7R4y0MHXDZ1h4XYnvdWi23EsQcmrC2bNzLOBz97uhW96o/fMcH8kre89CfY5n76WacwUu3vS7nCSQBgVYL9x1qVOIXBAQn2vImrKX2juKigzAjfOHdVNDZoZ7tSbDgx2lTTraOxGWqRNZMXqMlgI/R4iIKWVXEmfZ2QkBfLxxEeDMuox9IzuFp3m8BvZ2uwQF6hb+AGyrF4n8VZtR2Y6QONYgG8Wt2+4r/mS3e4deVrwlkEVGSSiyIx+ZLG2IHayI+89nwyIBch5mNgc/avrLZKi7+2PvHCj5UKcvAKaCXCy/1rExD9uhsGufGFhtAYsigkSU+4sQ2Pg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1691970291; bh=O55TUgo4d4IQG+fkXmOw9u/vA3CqGdwuNQKj8l2FpDq=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=FYi74/ZujFNXQZsy2y1RUluqjLUlZIj6+trmDms9TCscc4dDFuBHTVV2F00xfBy2oYBmAMtfOTznHjbORuAyP0mNdBO6XK0Zl4Gt4+NKZsg0kG6Ezmw2tRny14hpaNVV39Kzp9gq1+689II3sxqANqX+To2b6K+KbGRCg/FCpL2x83S5IX9+MAl/K/MIWadm61wdGGSOlvv/m9qD2uJOO+xaEBSc1MqIBICwIdAl6m63Wd4XsBibKS2h30EeliFVs6YqhFe0LpnbbIfzE1f4m/2hg6cmdi4Lx876a0F9FUKmriG60hBDx87JclQNtx+oYCIELTjhmb8NbslfVAToqQ== X-YMail-OSG: eUi67e0VM1kCrLbLR0btQjbi_p7QaZVFepiGjHjMcZsBtqAIgm6nodyXowYgHrM v_5WV5iCzcygTTpfh1R_LADxjy7_Pk_a992Z3Qh7L8k48AJRshuJnwtnZrkk8J2V9gz6aAQb63Gl JVdMlvIH2nfJguy71gQcnIw__Bv79a03MOHB_0ij3OuibvhX6ZauK1YJDn36_9LWQDKdvFLT1dkd MyE3Nm7IwBh2C2uIZO3FLx9FhoaUfCdNcGL4om5pAC6OXI0feSHgUq6ezwMMuZOpUIvfr2s5TA6m xo3ntUwUjCXLJGdhCF0pYvudalua9ZKNTQzersJ7ydyQKMV5dL1zisfFNnETYdo3fzqLH8EjZXIQ Ebny9oGVadeyWeXVQje7QoUyGayrVyy6sQRUVneYVuIdxs.XZHqJuXR2tPX9m32XN7TbUMkaZBlg SfJvz9ZP32atKxanu8Su5xMCfGFSZJIP5k7iZDOubFn1GxVPU.WQVZwUxaCFDt3dhdAC5t_Ic3aM SDuYVm1TrnzGUTfIwsoog26HpxH8U8AOydLYNe_liuybDc9ww_pONbaxT5vBizW0q5xb9SsjnnPC JvFzrJSdlPvcnDiQ6bv3evz8XA6ayXTiXOSvnBAWzv.Ps5yuDIWNt4SaZnqYEEx86.qMULL8F41R UpVcedK7Kjt0.oR8waSwArofrAcVRbvul1YDsDwXwnKfW3mxKX6ywE6tlLegCqlkKUCTsjDiXRr2 pBryrGAEEai0OiTt0ttBNieVidZ92qYOMFM.OpusIGteyo6ORNcs8wmJJuexhMbztzxHKDAJ.yck pvWRG5whqpQFPqEjVDXIe6TZVEdtb93TB3LIy2GwMq X-Sonic-MF: X-Sonic-ID: 1ef555a2-3384-4775-92a0-6371e615ae5e Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Sun, 13 Aug 2023 23:44:51 +0000 Original-Received: by hermes--production-sg3-69654d8bd-sbrjf (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 273403606b145ff1c66c3efae8afb3c4; Sun, 13 Aug 2023 23:44:45 +0000 (UTC) In-Reply-To: <3909139.bdzUSs2D5r@nimes> (Bruno Haible's message of "Sun, 13 Aug 2023 16:36:47 +0200") X-Mailer: WebService/1.1.21695 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.184.201; envelope-from=luangruo@yahoo.com; helo=sonic301-32.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Original-Sender: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.comp.lib.gnulib.bugs:48181 gmane.emacs.devel:308688 Archived-At: Bruno Haible writes: > Po Lu wrote: >> During the automated build of the Android port, the following errors >> were encountered with the Android NDK r10b and __ANDROID_API__ set to 8 >> (which is the oldest configuration Emacs supports.) >> ... >> boot-time.c: In function 'get_boot_time_uncached': >> boot-time.c:111:26: error: 'BOOT_TIME' undeclared (first use in this fun= ction) >> if (ut->ut_type =3D=3D BOOT_TIME) >> ^ > > Unlike USER_PROCESS, which is defined in all versions of Android's , > BOOT_TIME is only defined in newer versions. > > When compiling against an older version, we need to use the value from the > newer versions =E2=80=94 otherwise a binary built against an older versio= n might > not work right when running on a newer Android. > > This patch does it. > > > 2023-08-13 Bruno Haible > > readutmp, boot-time: Fix compilation error on old Android. > Reported by Po Lu in > . > * lib/readutmp.h (BOOT_TIME): Add fallback. > > diff --git a/lib/readutmp.h b/lib/readutmp.h > index 1cf588d265..f7cad36d44 100644 > --- a/lib/readutmp.h > +++ b/lib/readutmp.h > @@ -249,6 +249,13 @@ struct utmpx32 > # define WTMP_FILE "/etc/wtmp" > #endif >=20=20 > +/* In early versions of Android, did not define BOOT_TIME, only > + USER_PROCESS. We need to use the value that is defined in newer vers= ions > + of Android. */ > +#if defined __ANDROID__ && !defined BOOT_TIME > +# define BOOT_TIME 2 > +#endif > + > /* Some platforms, such as OpenBSD, don't have an ut_type field and don'= t have > the BOOT_TIME and USER_PROCESS macros. But we want to support them in > 'struct gl_utmp'. */ Both of your patches appear to work. Thanks.