From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by sourceware.org (Postfix) with ESMTPS id 7627A3850228 for ; Wed, 14 Sep 2022 17:04:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7627A3850228 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nefkom.net Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4MSRXQ11G5z1s88c; Wed, 14 Sep 2022 19:04:54 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4MSRXQ0Kfkz1qqkC; Wed, 14 Sep 2022 19:04:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id jVSDrJ_PdjuO; Wed, 14 Sep 2022 19:04:53 +0200 (CEST) X-Auth-Info: s9sXmZs4VifnmxaGVn4SqKJ3nhYUeaG6fqPelvy0StjLp9HAMaxDpb00sNgm87t8 Received: from igel.home (ppp-46-244-172-253.dynamic.mnet-online.de [46.244.172.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 14 Sep 2022 19:04:53 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id AE8CD2C263A; Wed, 14 Sep 2022 19:04:52 +0200 (CEST) From: Andreas Schwab To: Samuel Thibault Cc: libc-alpha@sourceware.org, commit-hurd@gnu.org Subject: Re: [hurd,commited] hurd: Fix readlink() hanging on fifo References: <20220914165827.118893-1-samuel.thibault@ens-lyon.org> X-Yow: If I am elected, the concrete barriers around the WHITE HOUSE will be replaced by tasteful foam replicas of ANN MARGARET! Date: Wed, 14 Sep 2022 19:04:52 +0200 In-Reply-To: <20220914165827.118893-1-samuel.thibault@ens-lyon.org> (Samuel Thibault's message of "Wed, 14 Sep 2022 18:58:27 +0200") Message-ID: <87tu59hop7.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sep 14 2022, Samuel Thibault wrote: > diff --git a/sysdeps/mach/hurd/readlink.c b/sysdeps/mach/hurd/readlink.c > index 770462714f..2d75ef7725 100644 > --- a/sysdeps/mach/hurd/readlink.c > +++ b/sysdeps/mach/hurd/readlink.c > @@ -31,7 +31,7 @@ __readlink (const char *file_name, char *buf, size_t len) > file_t file; > struct stat64 st; > > - file = __file_name_lookup (file_name, O_READ | O_NOLINK, 0); > + file = __file_name_lookup (file_name, O_NOLINK, 0); > if (file == MACH_PORT_NULL) > return -1; > > @@ -41,6 +41,9 @@ __readlink (const char *file_name, char *buf, size_t len) > { > char *rbuf = buf; > > + __mach_port_deallocate (__mach_task_self (), file); > + file = __file_name_lookup (file_name, O_READ | O_NOLINK, 0); How do you know that file_name still points at the same thing? -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."