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) continue; } /* 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); break; 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?