mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:27:45 +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);
|
||||
return -1;
|
||||
}
|
||||
*amaster = master;
|
||||
if (pid == 0) {
|
||||
close(master);
|
||||
if (login_tty(slave) < 0)
|
||||
_exit(1);
|
||||
return 0;
|
||||
}
|
||||
*amaster = master;
|
||||
close(slave);
|
||||
return pid;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue