mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
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:
parent
54dda2cdba
commit
41a11a5e83
@ -383,19 +383,21 @@ retry:
|
||||
exec call. */
|
||||
|
||||
for (i = 0; i < _hurd_nports; ++i)
|
||||
{
|
||||
*pdp++ = ports[i];
|
||||
for (j = 0; j < nportnames; j++)
|
||||
if (portnames[j] == ports[i])
|
||||
portnames[j] = MACH_PORT_NULL;
|
||||
}
|
||||
if (ports[i] != MACH_PORT_NULL)
|
||||
{
|
||||
*pdp++ = ports[i];
|
||||
for (j = 0; j < nportnames; j++)
|
||||
if (portnames[j] == ports[i])
|
||||
portnames[j] = MACH_PORT_NULL;
|
||||
}
|
||||
for (i = 0; i < dtablesize; ++i)
|
||||
{
|
||||
*pdp++ = dtable[i];
|
||||
for (j = 0; j < nportnames; j++)
|
||||
if (portnames[j] == dtable[i])
|
||||
portnames[j] = MACH_PORT_NULL;
|
||||
}
|
||||
if (dtable[i] != MACH_PORT_NULL)
|
||||
{
|
||||
*pdp++ = dtable[i];
|
||||
for (j = 0; j < nportnames; j++)
|
||||
if (portnames[j] == dtable[i])
|
||||
portnames[j] = MACH_PORT_NULL;
|
||||
}
|
||||
|
||||
/* Pack ports to be destroyed together. */
|
||||
for (i = 0, j = 0; i < nportnames; i++)
|
||||
|
@ -611,19 +611,21 @@ __rtld_execve (const char *file_name, char *const argv[],
|
||||
}
|
||||
|
||||
for (i = 0; i < portarraysize; ++i)
|
||||
{
|
||||
*pdp++ = ports[i];
|
||||
for (j = 0; j < nportnames; j++)
|
||||
if (portnames[j] == ports[i])
|
||||
portnames[j] = MACH_PORT_NULL;
|
||||
}
|
||||
if (ports[i] != MACH_PORT_NULL)
|
||||
{
|
||||
*pdp++ = ports[i];
|
||||
for (j = 0; j < nportnames; j++)
|
||||
if (portnames[j] == ports[i])
|
||||
portnames[j] = MACH_PORT_NULL;
|
||||
}
|
||||
for (i = 0; i < dtablesize; ++i)
|
||||
{
|
||||
*pdp++ = dtable[i];
|
||||
for (j = 0; j < nportnames; j++)
|
||||
if (portnames[j] == dtable[i])
|
||||
portnames[j] = MACH_PORT_NULL;
|
||||
}
|
||||
if (dtable[i] != MACH_PORT_NULL)
|
||||
{
|
||||
*pdp++ = dtable[i];
|
||||
for (j = 0; j < nportnames; j++)
|
||||
if (portnames[j] == dtable[i])
|
||||
portnames[j] = MACH_PORT_NULL;
|
||||
}
|
||||
|
||||
/* Pack ports to be destroyed together. */
|
||||
for (i = 0, j = 0; i < nportnames; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user