Skip to content

Commit

Permalink
LibC: Update forkpty() master fd before fork()'s child branch
Browse files Browse the repository at this point in the history
  • Loading branch information
linusg committed May 6, 2021
1 parent 5391836 commit 8779964
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibC/pty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8779964

Please sign in to comment.