From a09f62141d43f9f8ac2f0e5e8889fc62629a1d3d Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Mon, 16 Oct 2023 00:40:55 -0700 Subject: [PATCH] Fix bug in login_tty() --- libc/runtime/login_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/runtime/login_tty.c b/libc/runtime/login_tty.c index 1b49871b3..19ab68f44 100644 --- a/libc/runtime/login_tty.c +++ b/libc/runtime/login_tty.c @@ -53,9 +53,9 @@ int login_tty(int fd) { errno = e; // take control of teletypewriter (requires being leader) if ((rc = sys_ioctl(fd, TIOCSCTTY, 0)) != -1) { - unassert(!sys_dup2(fd, 0, 0)); - unassert(!sys_dup2(fd, 1, 0)); - unassert(!sys_dup2(fd, 2, 0)); + unassert(sys_dup2(fd, 0, 0) == 0); + unassert(sys_dup2(fd, 1, 0) == 1); + unassert(sys_dup2(fd, 2, 0) == 2); if (fd > 2) { unassert(!sys_close(fd)); }