commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hurd,commited] hurd: Fix readlink() hanging on fifo


From: Samuel Thibault
Subject: Re: [hurd,commited] hurd: Fix readlink() hanging on fifo
Date: Thu, 15 Sep 2022 21:56:44 +0200
User-agent: NeoMutt/20170609 (1.8.3)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]