Mercurial > dropbear
comparison cli-main.c @ 938:c88dce72f6d2
Make sure client exit messages don't get lost
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 09 Jul 2014 00:13:17 +0800 |
parents | aa689d140928 |
children | 5daedffd0769 |
comparison
equal
deleted
inserted
replaced
937:4ad38e223ccd | 938:c88dce72f6d2 |
---|---|
105 cli_opts.remoteport, format); | 105 cli_opts.remoteport, format); |
106 } | 106 } |
107 | 107 |
108 /* Do the cleanup first, since then the terminal will be reset */ | 108 /* Do the cleanup first, since then the terminal will be reset */ |
109 session_cleanup(); | 109 session_cleanup(); |
110 /* Avoid printing onwards from terminal cruft */ | |
111 fprintf(stderr, "\n"); | |
110 | 112 |
111 _dropbear_log(LOG_INFO, fmtbuf, param); | 113 _dropbear_log(LOG_INFO, fmtbuf, param); |
112 | |
113 exit(exitcode); | 114 exit(exitcode); |
114 } | 115 } |
115 | 116 |
116 static void cli_dropbear_log(int UNUSED(priority), | 117 static void cli_dropbear_log(int UNUSED(priority), |
117 const char* format, va_list param) { | 118 const char* format, va_list param) { |
119 char printbuf[1024]; | 120 char printbuf[1024]; |
120 | 121 |
121 vsnprintf(printbuf, sizeof(printbuf), format, param); | 122 vsnprintf(printbuf, sizeof(printbuf), format, param); |
122 | 123 |
123 fprintf(stderr, "%s: %s\n", cli_opts.progname, printbuf); | 124 fprintf(stderr, "%s: %s\n", cli_opts.progname, printbuf); |
124 | 125 fflush(stderr); |
125 } | 126 } |
126 | 127 |
127 static void exec_proxy_cmd(void *user_data_cmd) { | 128 static void exec_proxy_cmd(void *user_data_cmd) { |
128 const char *cmd = user_data_cmd; | 129 const char *cmd = user_data_cmd; |
129 char *usershell; | 130 char *usershell; |