From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 867D3383303D for ; Fri, 7 May 2021 19:21:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 867D3383303D Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6569A53AD2; Fri, 7 May 2021 21:21:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MnoQID8KdpGx; Fri, 7 May 2021 21:21:35 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 To: "Adhemerval Zanella" , Subject: Re: [PATCH 3/3] linux: implement ttyname as a wrapper around ttyname_r. From: =?utf-8?q?=C3=89rico_Nogueira?= Date: Fri, 07 May 2021 16:20:57 -0300 Message-Id: In-Reply-To: <53bc2e47-4845-d762-1a76-c7f1e7437941@linaro.org> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 19:21:41 -0000 On Fri May 7, 2021 at 2:21 PM -03, Adhemerval Zanella wrote: > > > On 04/05/2021 13:43, Adhemerval Zanella wrote: > >=20 > >=20 > > On 04/05/2021 13:37, Adhemerval Zanella wrote: > >>> - > >>> - if (!name && dostat !=3D -1) > >>> + int result =3D ttyname_r (fd, ttyname_buf, TTYNAME_BUFLEN); > >>> + if (result !=3D 0) > >> > >> Why do you need to pass the allocated buffer size minus 1? The ttyname= _r=20 > >> should handle it, it already pass buflen - 1 on readlink for instance. > >=20 > > You also need a libc_hidden_{proto,def} ttyname_r to avoid the intra > > PLT (the elf/check-localplt should have warned you about it). > >=20 > > I fixed my previous noted issues along with this one and push it > upstream, thanks for the patch. Ah, great! I hadn't gotten to this yet, thanks a lot for the help and reviews :)