From b6a02c44e8ff357712c24a7861691351f648c9a1 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 4 Oct 1999 16:14:34 +0000 Subject: [PATCH] [project @ 1999-10-04 16:14:34 by simonmar] Service signal handlers if we get an EINTR from select(2). --- ghc/rts/Select.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ghc/rts/Select.c b/ghc/rts/Select.c index 28a0370..0b8d0d6 100644 --- a/ghc/rts/Select.c +++ b/ghc/rts/Select.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Select.c,v 1.2 1999/09/13 08:28:45 sof Exp $ + * $Id: Select.c,v 1.3 1999/10/04 16:14:34 simonmar Exp $ * * (c) The GHC Team 1995-1999 * @@ -15,6 +15,7 @@ #include "RtsUtils.h" #include "RtsFlags.h" #include "Itimer.h" +#include "Signals.h" # if defined(HAVE_SYS_TYPES_H) # include @@ -114,6 +115,15 @@ awaitEvent(rtsBool wait) fprintf(stderr, "awaitEvent: select failed\n"); stg_exit(EXIT_FAILURE); } + /* We got a signal; could be one of ours. If so, we need + * to start up the signal handler straight away, otherwise + * we could block for a long time before the signal is + * serviced. + */ + if (signals_pending()) { + start_signal_handlers(); + return; + } } if (numFound != 0) { -- 1.7.10.4