hurd: optimize exec cleanup

When ports are nul we do not need to request their deallocation. It is
also useless to look for them in portnames.
This commit is contained in:
Samuel Thibault 2022-01-16 00:02:16 +01:00
parent 54dda2cdba
commit 41a11a5e83
2 changed files with 28 additions and 24 deletions

View file

@ -383,6 +383,7 @@ retry:
exec call. */
for (i = 0; i < _hurd_nports; ++i)
if (ports[i] != MACH_PORT_NULL)
{
*pdp++ = ports[i];
for (j = 0; j < nportnames; j++)
@ -390,6 +391,7 @@ retry:
portnames[j] = MACH_PORT_NULL;
}
for (i = 0; i < dtablesize; ++i)
if (dtable[i] != MACH_PORT_NULL)
{
*pdp++ = dtable[i];
for (j = 0; j < nportnames; j++)

View file

@ -611,6 +611,7 @@ __rtld_execve (const char *file_name, char *const argv[],
}
for (i = 0; i < portarraysize; ++i)
if (ports[i] != MACH_PORT_NULL)
{
*pdp++ = ports[i];
for (j = 0; j < nportnames; j++)
@ -618,6 +619,7 @@ __rtld_execve (const char *file_name, char *const argv[],
portnames[j] = MACH_PORT_NULL;
}
for (i = 0; i < dtablesize; ++i)
if (dtable[i] != MACH_PORT_NULL)
{
*pdp++ = dtable[i];
for (j = 0; j < nportnames; j++)