Skip to content
Snippets Groups Projects
Commit dd3e3d70 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 2000-04-04 10:04:47 by simonmar]

- make the second ^C kill the program immediately (the first one tries
  to interrupt it safely by killing all the threads, running
  finalizers etc.).

- don't ignore SIGPIPE by default, the program can do this itself.
parent 588b7cd3
No related merge requests found
/* -----------------------------------------------------------------------------
* $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
*
......@@ -264,7 +264,15 @@ shutdown_handler(int sig STG_UNUSED)
} 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();
}
}
/*
......@@ -274,10 +282,6 @@ shutdown_handler(int sig STG_UNUSED)
* 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()
......@@ -294,11 +298,6 @@ 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 */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment