diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.402 2013/05/17 00:13:14 djm Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.403 2013/06/05 02:27: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 |
@@ -1024,7 +1024,9 @@ server_accept_inetd(int *sock_in, int *sock_out) | |||
1024 | if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { | 1024 | if ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { |
1025 | dup2(fd, STDIN_FILENO); | 1025 | dup2(fd, STDIN_FILENO); |
1026 | dup2(fd, STDOUT_FILENO); | 1026 | dup2(fd, STDOUT_FILENO); |
1027 | if (fd > STDOUT_FILENO) | 1027 | if (!log_stderr) |
1028 | dup2(fd, STDERR_FILENO); | ||
1029 | if (fd > (log_stderr ? STDERR_FILENO : STDOUT_FILENO)) | ||
1028 | close(fd); | 1030 | close(fd); |
1029 | } | 1031 | } |
1030 | debug("inetd sockets after dupping: %d, %d", *sock_in, *sock_out); | 1032 | debug("inetd sockets after dupping: %d, %d", *sock_in, *sock_out); |