diff options
-rw-r--r-- | networking/telnetd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index 671529d37..07c6a6a73 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -314,6 +314,8 @@ make_new_session( | |||
314 | /* Restore default signal handling ASAP */ | 314 | /* Restore default signal handling ASAP */ |
315 | bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); | 315 | bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); |
316 | 316 | ||
317 | pid = getpid(); | ||
318 | |||
317 | if (ENABLE_FEATURE_UTMP) { | 319 | if (ENABLE_FEATURE_UTMP) { |
318 | len_and_sockaddr *lsa = get_peer_lsa(sock); | 320 | len_and_sockaddr *lsa = get_peer_lsa(sock); |
319 | char *hostname = NULL; | 321 | char *hostname = NULL; |
@@ -335,7 +337,6 @@ make_new_session( | |||
335 | xopen(tty_name, O_RDWR); /* becomes our ctty */ | 337 | xopen(tty_name, O_RDWR); /* becomes our ctty */ |
336 | xdup2(0, 1); | 338 | xdup2(0, 1); |
337 | xdup2(0, 2); | 339 | xdup2(0, 2); |
338 | pid = getpid(); | ||
339 | tcsetpgrp(0, pid); /* switch this tty's process group to us */ | 340 | tcsetpgrp(0, pid); /* switch this tty's process group to us */ |
340 | 341 | ||
341 | /* The pseudo-terminal allocated to the client is configured to operate | 342 | /* The pseudo-terminal allocated to the client is configured to operate |