tftpd: Don't forget to close stderr on startup.
Just like stdin and stdout, stderr is a copy of the listen socket inherited from inetd. We need to close it so inetd can process further requests, be restarted, etc. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38968
This commit is contained in:
parent
b4736c90ad
commit
77e83935b7
@ -381,8 +381,9 @@ main(int argc, char *argv[])
|
||||
me_sock.ss_family = peer_sock.ss_family;
|
||||
me_sock.ss_len = peer_sock.ss_len;
|
||||
}
|
||||
close(0);
|
||||
close(1);
|
||||
close(STDIN_FILENO);
|
||||
close(STDOUT_FILENO);
|
||||
close(STDERR_FILENO);
|
||||
peer = socket(peer_sock.ss_family, SOCK_DGRAM, 0);
|
||||
if (peer < 0) {
|
||||
tftp_log(LOG_ERR, "socket: %s", strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user