summaryrefslogtreecommitdiff
path: root/lib/libutil/login_tty.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2009-08-01 17:11:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2009-08-01 17:11:22 +0000
commit90d657c7b19376c384beed6912b76b86c85f28b2 (patch)
tree3e302589ab818cded1349219ecc9d1c528deabe2 /lib/libutil/login_tty.c
parent51affaf05614d2885578f883b23f667ba2114119 (diff)
Use STD*_FILENO instead of 0-2. OK henning@ djm@ gilles@ dhill@
Diffstat (limited to 'lib/libutil/login_tty.c')
-rw-r--r--lib/libutil/login_tty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libutil/login_tty.c b/lib/libutil/login_tty.c
index 7a7c6a4419a..3a0ce71aac4 100644
--- a/lib/libutil/login_tty.c
+++ b/lib/libutil/login_tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_tty.c,v 1.7 2005/08/02 21:46:23 espie Exp $ */
+/* $OpenBSD: login_tty.c,v 1.8 2009/08/01 17:11:21 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -40,10 +40,10 @@ login_tty(int fd)
(void) setsid();
if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
return (-1);
- (void) dup2(fd, 0);
- (void) dup2(fd, 1);
- (void) dup2(fd, 2);
- if (fd > 2)
+ (void) dup2(fd, STDIN_FILENO);
+ (void) dup2(fd, STDOUT_FILENO);
+ (void) dup2(fd, STDERR_FILENO);
+ if (fd > STDERR_FILENO)
(void) close(fd);
return (0);
}