From: minima Date: Sun, 13 Jan 2002 21:49:51 +0000 (+0000) Subject: changed the backstop termination alarm routing in the C client so that X-Git-Tag: R_1_50~79 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=81bd571ef4d8b2b9762738cf70cd5b644c368dc5;p=spider.git changed the backstop termination alarm routing in the C client so that it flushes the input and output buffer and then commits suicide. --- diff --git a/Changes b/Changes index 3dda9151..1cc0a163 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +13Jan02======================================================================= +1. changed the backstop termination alarm routing in the C client so that +it flushes the input and output buffer and then commits suicide. 12Jan02======================================================================= 1. put setsockopts into eval block to allow some of them to fail 11Jan02======================================================================= diff --git a/src/client.c b/src/client.c index 69a8aaeb..7b98f661 100644 --- a/src/client.c +++ b/src/client.c @@ -723,13 +723,8 @@ void process_node() void term_timeout(int i) { /* none of this is going to be reused so don't bother cleaning up properly */ - if (in && in->t_set) - tcsetattr(0, TCSANOW, &in->t); - if (node) { - shutdown(node->cnum, 3); - close(node->cnum); - } - exit(i); + tcflush(0, TCIOFLUSH); + kill(getpid(), 9); /* commit suicide */ } void terminate(int i) @@ -919,8 +914,7 @@ main(int argc, char *argv[]) /* connect up stdin */ in = fcb_new(0, TEXT); in->sp = sel_open(0, in, "STDIN", fcb_handler, TEXT, SEL_INPUT); - if (tcgetattr(0, &in->t) < 0) { -/* echo = 0; */ + if (!isatty(0) || tcgetattr(0, &in->t) < 0) { in->echo = echo; in->t_set = 0; } else {