home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1990 Jay Konigsberg - see Makefile for details
- * This is Free Software, distrubited under the GNU Software Aggrement.
- */
-
- #include "simped.h"
-
- /* Global for interrupt routine: cleanup() */
- extern struct termio ttyset; /* terminal settings */
- extern unsigned short c_lflag_hold; /* hold original values for reset */
- extern unsigned char VEOF_hold; /* hold original value for reset */
-
- int cleanup(sig_caught) /* Signal trap for SIGINT */
- int sig_caught;
- {
- void exit();
-
- int ioctl(),
- fprintf();
-
- /* reset terminal charastics */
- ttyset.c_lflag = c_lflag_hold;
- ttyset.c_cc[4] = VEOF_hold;
- if ( ioctl(0, TCSETAW, &ttyset) == -1) {
- fprintf(stderr, "ioctl: error=%d\n", errno);
- exit(2);
- }
- if (sig_caught)
- {
- fprintf(stderr,"\nMessage aborted.\n");
- }
- exit(2);
- return(0);
- }
-