Mercurial > dropbear
comparison cli-chansession.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 | 5dda5a4d475c |
children | d3eb1fa8484e |
comparison
equal
deleted
inserted
replaced
98:297167ef41bd | 99:0247fbd9379d |
---|---|
61 dropbear_log(LOG_INFO, "Waiting for other channels to close..."); | 61 dropbear_log(LOG_INFO, "Waiting for other channels to close..."); |
62 } | 62 } |
63 | 63 |
64 cli_tty_cleanup(); /* Restore tty modes etc */ | 64 cli_tty_cleanup(); /* Restore tty modes etc */ |
65 | 65 |
66 /* Set stdin back to non-blocking - busybox ash dies nastily | |
67 * if we don't revert the flags */ | |
68 fcntl(cli_ses.stdincopy, F_SETFL, cli_ses.stdinflags); | |
69 | |
70 } | 66 } |
71 | 67 |
72 static void start_channel_request(struct Channel *channel, | 68 static void start_channel_request(struct Channel *channel, |
73 unsigned char *type) { | 69 unsigned char *type) { |
74 | 70 |
315 TRACE(("leave send_chansess_shell_req")); | 311 TRACE(("leave send_chansess_shell_req")); |
316 } | 312 } |
317 | 313 |
318 static int cli_initchansess(struct Channel *channel) { | 314 static int cli_initchansess(struct Channel *channel) { |
319 | 315 |
320 /* We store stdin's flags, so we can set them back on exit (otherwise | |
321 * busybox's ash isn't happy */ | |
322 cli_ses.stdincopy = dup(STDIN_FILENO); | |
323 cli_ses.stdinflags = fcntl(STDIN_FILENO, F_GETFL, 0); | |
324 | 316 |
325 channel->infd = STDOUT_FILENO; | 317 channel->infd = STDOUT_FILENO; |
326 //channel->outfd = STDIN_FILENO; | 318 channel->outfd = STDIN_FILENO; |
327 //channel->errfd = STDERR_FILENO; | 319 //channel->errfd = STDERR_FILENO; |
328 | 320 |
329 if (cli_opts.wantpty) { | 321 if (cli_opts.wantpty) { |
330 send_chansess_pty_req(channel); | 322 send_chansess_pty_req(channel); |
331 } | 323 } |