/* -----------------------------------------------------------------------------
- * $Id: Signals.c,v 1.15 2000/03/15 15:31:36 simonmar Exp $
+ * $Id: Signals.c,v 1.16 2000/04/04 10:04:47 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
} else
#endif
- interruptStgRts();
+ /* If we're already trying to interrupt the RTS, terminate with
+ * extreme prejudice. So the first ^C tries to exit the program
+ * cleanly, and the second one just kills it.
+ */
+ if (interrupted) {
+ exit(EXIT_INTERRUPTED);
+ } else {
+ interruptStgRts();
+ }
}
/*
* Haskell code may install their own SIGINT handler, which is
* fine, provided they're so kind as to put back the old one
* when they de-install.
- *
- * We ignore SIGPIPE, because our I/O library handles EPIPE properly,
- * and a SIGPIPE tends to cause the program to exit silently and
- * mysteriously.
*/
void
init_default_handlers()
/* Oh well, at least we tried. */
prog_belch("failed to install SIGINT handler");
}
-
- action.sa_handler = SIG_IGN;
- if (sigaction(SIGPIPE, &action, &oact) != 0) {
- prog_belch("failed to install SIGINT handler");
- }
}
#endif /*! mingw32_TARGET_OS */