Browse Source

Use STD*_FILENO instead of 0-2. OK henning@ djm@ gilles@ dhill@

OPENBSD_4_7
millert 15 years ago
parent
commit
4bfe74412c
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/lib/libutil/login_tty.c

+ 5
- 5
src/lib/libutil/login_tty.c View File

@ -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 * Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -40,10 +40,10 @@ login_tty(int fd)
(void) setsid(); (void) setsid();
if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1) if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
return (-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); (void) close(fd);
return (0); return (0);
} }

Loading…
Cancel
Save