diff -c -r1.1 tip.c *** /tmp/,RCSt1G48409 Mon Jul 5 18:13:45 1999 --- tip.c Mon Jul 5 18:13:13 1999 *************** *** 80,85 **** --- 80,86 ---- void intprompt(); void timeout(); + void killchild(); void cleanup(); void tipdone(); char *sname(); *************** *** 285,290 **** --- 286,300 ---- } void + killchild() + { + if (pid != 0) { + kill(pid, SIGTERM); + pid = 0; + } + } + + void cleanup() { *************** *** 425,430 **** --- 435,442 ---- { int i; char gch, bol = 1; + + atexit(killchild); /* * Kinda klugey here... RCS file: RCS/tipout.c,v retrieving revision 1.1 diff -c -r1.1 tipout.c *** /tmp/,RCSt1E48414 Mon Jul 5 18:13:46 1999 --- tipout.c Mon Jul 5 17:49:07 1999 *************** *** 160,166 **** omask = sigblock(ALLSIGS); for (cp = buf; cp < buf + cnt; cp++) *cp &= 0177; ! write(1, buf, cnt); if (boolean(value(SCRIPT)) && fscript != NULL) { if (!boolean(value(BEAUTIFY))) { fwrite(buf, 1, cnt, fscript); --- 160,167 ---- omask = sigblock(ALLSIGS); for (cp = buf; cp < buf + cnt; cp++) *cp &= 0177; ! if (write(1, buf, cnt) < 0) ! exit(1); if (boolean(value(SCRIPT)) && fscript != NULL) { if (!boolean(value(BEAUTIFY))) { fwrite(buf, 1, cnt, fscript);