mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
LibC: Update forkpty() master fd before fork()'s child branch
This commit is contained in:
parent
5391836468
commit
877996465a
1 changed files with 1 additions and 1 deletions
|
@ -79,13 +79,13 @@ pid_t forkpty(int* amaster, char* name, const struct termios* termp, const struc
|
||||||
close(slave);
|
close(slave);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
*amaster = master;
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
close(master);
|
close(master);
|
||||||
if (login_tty(slave) < 0)
|
if (login_tty(slave) < 0)
|
||||||
_exit(1);
|
_exit(1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*amaster = master;
|
|
||||||
close(slave);
|
close(slave);
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue