diff options
author | 2009-08-01 17:11:21 +0000 | |
---|---|---|
committer | 2009-08-01 17:11:21 +0000 | |
commit | 43a9fe7e8750c5eccb3ade3de18283fb2eb45fc0 (patch) | |
tree | 80ab691de271055bb531b5947438565405968aac | |
parent | Revert previous change which enabled symbol visibility support; appears to (diff) | |
download | wireguard-openbsd-43a9fe7e8750c5eccb3ade3de18283fb2eb45fc0.tar.xz wireguard-openbsd-43a9fe7e8750c5eccb3ade3de18283fb2eb45fc0.zip |
Use STD*_FILENO instead of 0-2. OK henning@ djm@ gilles@ dhill@
-rw-r--r-- | lib/libutil/login_tty.c | 10 |
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); } |