summaryrefslogtreecommitdiffhomepage
path: root/cli-session.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2005-07-08 13:28:03 +0000
committerMatt Johnston <matt@ucc.asn.au>2005-07-08 13:28:03 +0000
commitaaa0b1ec3c8e0fe9d827565f17a06e87abe8bfa3 (patch)
tree4e71aec4c8f68f799c9dbdf1107923af9efc7a94 /cli-session.c
parent03731c723bda295a6f6ee8346d622ea45d796563 (diff)
parent215a369c2b0e49107f3a7e9d55175bd590145836 (diff)
merge of 9522146cb07d4576f161fc4567c2c2fbd6f61fbb
and b11630c15bc4d0649dba51c3572cac6f44e0ab0e --HG-- extra : convert_revision : e0686662cdbee8c0b06e72e6105a390ea4f4c007
Diffstat (limited to 'cli-session.c')
-rw-r--r--cli-session.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/cli-session.c b/cli-session.c
index 4d6a645..8b58526 100644
--- a/cli-session.c
+++ b/cli-session.c
@@ -113,16 +113,20 @@ static void cli_session_init() {
cli_ses.tty_raw_mode = 0;
cli_ses.winchange = 0;
- /* We store stdin's flags, so we can set them back on exit (otherwise
- * busybox's ash isn't happy */
+ /* We store std{in,out,err}'s flags, so we can set them back on exit
+ * (otherwise busybox's ash isn't happy */
cli_ses.stdincopy = dup(STDIN_FILENO);
cli_ses.stdinflags = fcntl(STDIN_FILENO, F_GETFL, 0);
+ cli_ses.stdoutcopy = dup(STDOUT_FILENO);
+ cli_ses.stdoutflags = fcntl(STDOUT_FILENO, F_GETFL, 0);
+ cli_ses.stderrcopy = dup(STDERR_FILENO);
+ cli_ses.stderrflags = fcntl(STDERR_FILENO, F_GETFL, 0);
cli_ses.retval = EXIT_SUCCESS; /* Assume it's clean if we don't get a
specific exit status */
/* Auth */
- cli_ses.lastpubkey = NULL;
+ cli_ses.lastprivkey = NULL;
cli_ses.lastauthtype = 0;
/* For printing "remote host closed" for the user */
@@ -250,9 +254,11 @@ void cli_session_cleanup() {
return;
}
- /* Set stdin back to non-blocking - busybox ash dies nastily
- * if we don't revert the flags */
+ /* Set std{in,out,err} back to non-blocking - busybox ash dies nastily if
+ * we don't revert the flags */
fcntl(cli_ses.stdincopy, F_SETFL, cli_ses.stdinflags);
+ fcntl(cli_ses.stdoutcopy, F_SETFL, cli_ses.stdoutflags);
+ fcntl(cli_ses.stderrcopy, F_SETFL, cli_ses.stderrflags);
cli_tty_cleanup();