diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.476 2016/09/28 16:33:07 djm Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.477 2016/11/29 03:54:50 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -123,10 +123,6 @@ | |||
123 | #include "version.h" | 123 | #include "version.h" |
124 | #include "ssherr.h" | 124 | #include "ssherr.h" |
125 | 125 | ||
126 | #ifndef O_NOCTTY | ||
127 | #define O_NOCTTY 0 | ||
128 | #endif | ||
129 | |||
130 | /* Re-exec fds */ | 126 | /* Re-exec fds */ |
131 | #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) | 127 | #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) |
132 | #define REEXEC_STARTUP_PIPE_FD (STDERR_FILENO + 2) | 128 | #define REEXEC_STARTUP_PIPE_FD (STDERR_FILENO + 2) |
@@ -1807,20 +1803,11 @@ main(int ac, char **av) | |||
1807 | * exits. | 1803 | * exits. |
1808 | */ | 1804 | */ |
1809 | if (!(debug_flag || inetd_flag || no_daemon_flag)) { | 1805 | if (!(debug_flag || inetd_flag || no_daemon_flag)) { |
1810 | #ifdef TIOCNOTTY | 1806 | |
1811 | int fd; | ||
1812 | #endif /* TIOCNOTTY */ | ||
1813 | if (daemon(0, 0) < 0) | 1807 | if (daemon(0, 0) < 0) |
1814 | fatal("daemon() failed: %.200s", strerror(errno)); | 1808 | fatal("daemon() failed: %.200s", strerror(errno)); |
1815 | 1809 | ||
1816 | /* Disconnect from the controlling tty. */ | 1810 | disconnect_controlling_tty(); |
1817 | #ifdef TIOCNOTTY | ||
1818 | fd = open(_PATH_TTY, O_RDWR | O_NOCTTY); | ||
1819 | if (fd >= 0) { | ||
1820 | (void) ioctl(fd, TIOCNOTTY, NULL); | ||
1821 | close(fd); | ||
1822 | } | ||
1823 | #endif /* TIOCNOTTY */ | ||
1824 | } | 1811 | } |
1825 | /* Reinitialize the log (because of the fork above). */ | 1812 | /* Reinitialize the log (because of the fork above). */ |
1826 | log_init(__progname, options.log_level, options.log_facility, log_stderr); | 1813 | log_init(__progname, options.log_level, options.log_facility, log_stderr); |