[Top][All Lists]

[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: Fri, 15 Feb 2013 10:54:44 +0100

On Fri, 2013-02-15 at 00:58 +0100, Samuel Thibault wrote:
> Svante Signell, le Fri 15 Feb 2013 00:37:39 +0100, a écrit :
> > > No, it doesn't. There are quite a few ways in which it will break.

>                if (d[i].io_port == MACH_PORT_NULL)
>                  {
>                    _hurd_port_free (&d[i].cell->port,
> Doesn't make sense either. You haven't understood what the original code
> was doing (cleaning the previously allocated ports, not this newly one).

I did understand the code, but maybe the change went wrong. I would
really appreciate if you could help me to understand what's the problem
with the new code.

Old code: (cleaning previously allocated ports when one FD is bogus and
exit out of the loop)
           if (fd < _hurd_dtablesize)
                if (d[i].io_port != MACH_PORT_NULL)

            /* If one descriptor is bogus, we fail completely.  */
            while (i-- > 0)
              if (d[i].type != 0)
                _hurd_port_free (&d[i].cell->port,
                                 &d[i].ulink, d[i].io_port);

New code: (cleaning the ports allocated for bogus FDs, and continue to
next i)
                /* 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 */

Is the test for MACH_PORT_NULL wrong? Maybe it is not needed at all, the
ports for bogus FDs can be kept, doing no harm?

reply via email to

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