diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-21 09:22:28 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-21 09:22:28 +0000 |
commit | 1101d1c98068d7a49942d6e9e11ca2e789a9cdba (patch) | |
tree | 8fcf79323f16e9e29ad0e257184ce4714b29c23b /networking/telnetd.c | |
parent | 84c8daa11f4c656bb4ba50b6e1c6d3b34c0f1b39 (diff) | |
download | busybox-w32-1101d1c98068d7a49942d6e9e11ca2e789a9cdba.tar.gz busybox-w32-1101d1c98068d7a49942d6e9e11ca2e789a9cdba.tar.bz2 busybox-w32-1101d1c98068d7a49942d6e9e11ca2e789a9cdba.zip |
telnet: shrink
telnetd: shrink, and fix issue file printing
test: better and shorter usage text
function old new delta
putiac2 51 50 -1
putiac 24 20 -4
handlenetoutput 95 91 -4
telnet_main 1480 1475 -5
iacflush 37 32 -5
make_new_session 436 421 -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-34) Total: -34 bytes
Diffstat (limited to 'networking/telnetd.c')
-rw-r--r-- | networking/telnetd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index 22ecb3ca8..7f748641b 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -229,11 +229,10 @@ make_new_session( | |||
229 | /* open the child's side of the tty. */ | 229 | /* open the child's side of the tty. */ |
230 | /* NB: setsid() disconnects from any previous ctty's. Therefore | 230 | /* NB: setsid() disconnects from any previous ctty's. Therefore |
231 | * we must open child's side of the tty AFTER setsid! */ | 231 | * we must open child's side of the tty AFTER setsid! */ |
232 | fd = xopen(tty_name, O_RDWR); /* becomes our ctty */ | 232 | close(0); |
233 | dup2(fd, 0); | 233 | xopen(tty_name, O_RDWR); /* becomes our ctty */ |
234 | dup2(fd, 1); | 234 | xdup2(0, 1); |
235 | dup2(fd, 2); | 235 | xdup2(0, 2); |
236 | while (fd > 2) close(fd--); | ||
237 | tcsetpgrp(0, getpid()); /* switch this tty's process group to us */ | 236 | tcsetpgrp(0, getpid()); /* switch this tty's process group to us */ |
238 | 237 | ||
239 | /* The pseudo-terminal allocated to the client is configured to operate in | 238 | /* The pseudo-terminal allocated to the client is configured to operate in |
@@ -252,7 +251,7 @@ make_new_session( | |||
252 | * issue files, and they may block writing to fd 1, | 251 | * issue files, and they may block writing to fd 1, |
253 | * (parent is supposed to read it, but parent waits | 252 | * (parent is supposed to read it, but parent waits |
254 | * for vforked child to exec!) */ | 253 | * for vforked child to exec!) */ |
255 | print_login_issue(issuefile, NULL); | 254 | print_login_issue(issuefile, tty_name); |
256 | 255 | ||
257 | /* Exec shell / login / whatever */ | 256 | /* Exec shell / login / whatever */ |
258 | login_argv[0] = loginpath; | 257 | login_argv[0] = loginpath; |