comparison cli-session.c @ 108:10f4d3319780

- added circular buffering for channels - added stderr support for the client - cleaned up a bunch of "unused" warnings, duplicated header definitions - added exit-status support for the client
author Matt Johnston <matt@ucc.asn.au>
date Thu, 26 Aug 2004 13:16:40 +0000
parents d3eb1fa8484e
children fb7147e2fb04
comparison
equal deleted inserted replaced
107:d3eb1fa8484e 108:10f4d3319780
116 /* We store stdin's flags, so we can set them back on exit (otherwise 116 /* We store stdin's flags, so we can set them back on exit (otherwise
117 * busybox's ash isn't happy */ 117 * busybox's ash isn't happy */
118 cli_ses.stdincopy = dup(STDIN_FILENO); 118 cli_ses.stdincopy = dup(STDIN_FILENO);
119 cli_ses.stdinflags = fcntl(STDIN_FILENO, F_GETFL, 0); 119 cli_ses.stdinflags = fcntl(STDIN_FILENO, F_GETFL, 0);
120 120
121 cli_ses.retval = EXIT_SUCCESS; /* Assume it's clean if we don't get a
122 specific exit status */
123
121 /* Auth */ 124 /* Auth */
122 cli_ses.lastpubkey = NULL; 125 cli_ses.lastpubkey = NULL;
123 cli_ses.lastauthtype = NULL; 126 cli_ses.lastauthtype = NULL;
124 127
125 /* For printing "remote host closed" for the user */ 128 /* For printing "remote host closed" for the user */
259 262
260 cli_session_cleanup(); 263 cli_session_cleanup();
261 common_session_cleanup(); 264 common_session_cleanup();
262 fprintf(stderr, "Connection to %s@%s:%s closed.\n", cli_opts.username, 265 fprintf(stderr, "Connection to %s@%s:%s closed.\n", cli_opts.username,
263 cli_opts.remotehost, cli_opts.remoteport); 266 cli_opts.remotehost, cli_opts.remoteport);
264 exit(EXIT_SUCCESS); 267 exit(cli_ses.retval);
265 } 268 }
266 269
267 270
268 /* called when the remote side closes the connection */ 271 /* called when the remote side closes the connection */
269 static void cli_remoteclosed() { 272 static void cli_remoteclosed() {