comparison cli-session.c @ 99:0247fbd9379d

Move the revert-to-non-blocking-stdin code to cli-session so it always gets hit.
author Matt Johnston <matt@ucc.asn.au>
date Sun, 22 Aug 2004 09:23:59 +0000
parents e3adf4cf5465
children c72f5c10125d
comparison
equal deleted inserted replaced
98:297167ef41bd 99:0247fbd9379d
110 cli_ses.kex_state = KEX_NOTHING; 110 cli_ses.kex_state = KEX_NOTHING;
111 111
112 cli_ses.tty_raw_mode = 0; 112 cli_ses.tty_raw_mode = 0;
113 cli_ses.winchange = 0; 113 cli_ses.winchange = 0;
114 114
115 /* We store stdin's flags, so we can set them back on exit (otherwise
116 * busybox's ash isn't happy */
117 cli_ses.stdincopy = dup(STDIN_FILENO);
118 cli_ses.stdinflags = fcntl(STDIN_FILENO, F_GETFL, 0);
119
115 /* Auth */ 120 /* Auth */
116 cli_ses.lastpubkey = NULL; 121 cli_ses.lastpubkey = NULL;
117 cli_ses.lastauthtype = NULL; 122 cli_ses.lastauthtype = NULL;
118 123
119 /* For printing "remote host closed" for the user */ 124 /* For printing "remote host closed" for the user */
238 void cli_session_cleanup() { 243 void cli_session_cleanup() {
239 244
240 if (!sessinitdone) { 245 if (!sessinitdone) {
241 return; 246 return;
242 } 247 }
248
249 /* Set stdin back to non-blocking - busybox ash dies nastily
250 * if we don't revert the flags */
251 TRACE(("close stdincopy = %d", cli_ses.stdincopy));
252 //fcntl(cli_ses.stdincopy, F_SETFL, cli_ses.stdinflags);
253
243 cli_tty_cleanup(); 254 cli_tty_cleanup();
244 255
245 } 256 }
246 257
247 static void cli_finished() { 258 static void cli_finished() {