mirror of git://sourceware.org/git/glibc.git
hurd spawni: Fix reauthenticating closed fds
When an fd is closed, the port cell remains, but the port becomes MACH_PORT_NULL, so we have to guard against it.
This commit is contained in:
parent
c1b68685d4
commit
eff158b75d
|
@ -154,7 +154,7 @@ __spawni (pid_t *pid, const char *file,
|
||||||
reauthenticated, or was newly opened on behalf of the child. */
|
reauthenticated, or was newly opened on behalf of the child. */
|
||||||
error_t reauthenticate_fd (int fd)
|
error_t reauthenticate_fd (int fd)
|
||||||
{
|
{
|
||||||
if (dtable_cells[fd] != NULL)
|
if (dtable_cells[fd] != NULL && dtable[fd] != MACH_PORT_NULL)
|
||||||
{
|
{
|
||||||
file_t newfile;
|
file_t newfile;
|
||||||
mach_port_t ref = __mach_reply_port ();
|
mach_port_t ref = __mach_reply_port ();
|
||||||
|
|
Loading…
Reference in New Issue