From fc3a6dd2e0bb726e8ee521e5806439181f93b995 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 12 Sep 2007 14:56:47 +0000 Subject: in pPrPr_disableITimers (who made up that name?) call the RTS to disable the timer Since we switched to using timer_create() in the RTS, this function has been failing to disables the timer interrupts. This turns out to be the cause of the random framework failures in the test suite. Invoking the RTS to turn off the timer signal is the right thing. --- cbits/execvpe.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'cbits') diff --git a/cbits/execvpe.c b/cbits/execvpe.c index 160271c..1d96aa5 100644 --- a/cbits/execvpe.c +++ b/cbits/execvpe.c @@ -5,6 +5,10 @@ -------------------------------------------------------------------------- */ #include "execvpe.h" +#ifdef __GLASGOW_HASKELL__ +#include "Rts.h" +#endif + #if !(defined(_MSC_VER) || defined(__MINGW32__) || defined(_WIN32)) /* to the end */ /* Evidently non-Posix. */ @@ -158,18 +162,9 @@ execvpe(char *name, char *const argv[], char **envp) /* Copied verbatim from ghc/lib/std/cbits/system.c. */ void pPrPr_disableITimers (void) { -# ifdef HAVE_SETITIMER - /* Reset the itimers in the child, so it doesn't get plagued - * by SIGVTALRM interrupts. - */ - struct timeval tv_null = { 0, 0 }; - struct itimerval itv; - itv.it_interval = tv_null; - itv.it_value = tv_null; - setitimer(ITIMER_REAL, &itv, NULL); - setitimer(ITIMER_VIRTUAL, &itv, NULL); - setitimer(ITIMER_PROF, &itv, NULL); -# endif +#ifdef __GLASGOW_HASKELL__ + stopTimer(); +#endif } #endif -- cgit v1.2.3