mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 15:38:22 +00:00
Fix bug in login_tty()
This commit is contained in:
parent
ed17d3008b
commit
a09f62141d
1 changed files with 3 additions and 3 deletions
|
@ -53,9 +53,9 @@ int login_tty(int fd) {
|
||||||
errno = e;
|
errno = e;
|
||||||
// take control of teletypewriter (requires being leader)
|
// take control of teletypewriter (requires being leader)
|
||||||
if ((rc = sys_ioctl(fd, TIOCSCTTY, 0)) != -1) {
|
if ((rc = sys_ioctl(fd, TIOCSCTTY, 0)) != -1) {
|
||||||
unassert(!sys_dup2(fd, 0, 0));
|
unassert(sys_dup2(fd, 0, 0) == 0);
|
||||||
unassert(!sys_dup2(fd, 1, 0));
|
unassert(sys_dup2(fd, 1, 0) == 1);
|
||||||
unassert(!sys_dup2(fd, 2, 0));
|
unassert(sys_dup2(fd, 2, 0) == 2);
|
||||||
if (fd > 2) {
|
if (fd > 2) {
|
||||||
unassert(!sys_close(fd));
|
unassert(!sys_close(fd));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue