changed the backstop termination alarm routing in the C client so that
authorminima <minima>
Sun, 13 Jan 2002 21:49:51 +0000 (21:49 +0000)
committerminima <minima>
Sun, 13 Jan 2002 21:49:51 +0000 (21:49 +0000)
it flushes the input and output buffer and then commits suicide.

Changes
src/client.c

diff --git a/Changes b/Changes
index 3dda915118e370138a3f89a9382ed6d510a0a38d..1cc0a163ec9d663301303153557f56c669658b4c 100644 (file)
--- 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=======================================================================
index 69a8aaebd099eb180452eb601098a2d55462645c..7b98f66129bb717914495cdbc7b38305667ae300 100644 (file)
@@ -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 {