+Thu Jan 13 21:00:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
+
+ * casefile.c main.c: Moved the SIGINT handler from casefile.c to
+ main.c. Removed the handler for SIGQUIT.
+
Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
* casefile.c: Added a signal handler to delete temp files on SIGINT and SIGQUIT
#include "misc.h"
#include "settings.h"
#include "var.h"
-#include "signal.h"
#ifdef HAVE_VALGRIND_VALGRIND_H
#include <valgrind/valgrind.h>
return bytes_written;
}
+
/* Registers our exit handler with atexit() if it has not already
been registered. */
static void
if (!registered)
{
registered = 1;
- signal (SIGQUIT, (sighandler_t) exit_handler);
- signal (SIGINT, (sighandler_t) exit_handler);
atexit (exit_handler);
}
}
+
+
/* atexit() handler that closes and deletes our temporary
files. */
static void
/* If a segfault happens, issue a message to that effect and halt */
void bug_handler(int sig);
+/* Handle quit/term/int signals */
+void interrupt_handler(int sig);
+
/* Whether we're dropping down to interactive mode immediately because
we hit end-of-file unexpectedly (or whatever). */
int start_interactive;
+
+
+
+
/* Program entry point. */
int
main (int argc, char **argv)
{
+
signal (SIGSEGV, bug_handler);
- signal (SIGFPE, bug_handler);
+ signal (SIGFPE, bug_handler);
+ signal (SIGINT, interrupt_handler);
gsl_set_error_handler_off();
break;
}
}
+
+
+void
+interrupt_handler(int sig UNUSED)
+{
+ err_hcf(0);
+}