bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finish


From: Svante Signell
Subject: Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished
Date: Mon, 18 Feb 2013 17:13:10 +0100

On Fri, 2013-02-15 at 19:59 +0100, Samuel Thibault wrote:
> Svante Signell, le Fri 15 Feb 2013 10:54:44 +0100, a écrit :

> 
> So it's ii-1 whose array position gets _hurd_port_free()d. array
> position ii does *not* get _hurd_port_free()d, while
> 
> >                 /* If one descriptor is bogus, mark and remove it.  */
> >                 if (d[i].io_port == MACH_PORT_NULL)
> >                   {
> >                     _hurd_port_free (&d[i].cell->port,
> >                                      &d[i].ulink, d[i].io_port);
> >                     continue; /* Next i */
> >                   }
> 
> This does _hurd_port_free() array position ii, even if it is actually
> undefined since _hurd_port_get returning MACH_PORT_NULL means it didn't
> work (and thus didn't fill the array position).

So the correct change would be to remove the call to _hurd_port_free()?
BTW: Looking at the definition of _hurd_port_free (.., .., used_port)
reveals that if the used_port is MACH_PORT_NULL the function call
returns immediately, so no harm is done.






reply via email to

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