public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: libc-alpha@sourceware.org, commit-hurd@gnu.org
Subject: Re: [hurd,commited] hurd: Fix readlink() hanging on fifo
Date: Thu, 15 Sep 2022 21:56:44 +0200	[thread overview]
Message-ID: <20220915195644.ewv5ksmioip7lxlk@begin> (raw)
In-Reply-To: <87tu59hop7.fsf@igel.home>

Andreas Schwab, le mer. 14 sept. 2022 19:04:52 +0200, a ecrit:
> 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?

Righ, better make that atomic. I have pushed it so.

Thanks,
Samuel

      reply	other threads:[~2022-09-15 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 16:58 Samuel Thibault
2022-09-14 17:04 ` Andreas Schwab
2022-09-15 19:56   ` Samuel Thibault [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220915195644.ewv5ksmioip7lxlk@begin \
    --to=samuel.thibault@gnu.org \
    --cc=commit-hurd@gnu.org \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).