From 5706d07c74e75cb1cf6125f6d758f11264fa04ef Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 14 Jul 1999 13:42:28 +0000 Subject: [PATCH] [project @ 1999-07-14 13:39:46 by simonmar] Workaround bug in Linux's glibc 2.1: don't fflush(stdout) before writing to stderr. --- ghc/rts/PrimOps.hc | 3 +-- ghc/rts/Signals.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ghc/rts/PrimOps.hc b/ghc/rts/PrimOps.hc index 8d9be51..84ecf27 100644 --- a/ghc/rts/PrimOps.hc +++ b/ghc/rts/PrimOps.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.hc,v 1.27 1999/05/13 17:31:11 simonm Exp $ + * $Id: PrimOps.hc,v 1.28 1999/07/14 13:42:28 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -867,7 +867,6 @@ FN_(putMVarzh_fast) mvar = (StgMVar *)R1.p; if (GET_INFO(mvar) == &FULL_MVAR_info) { - fflush(stdout); fprintf(stderr, "putMVar#: MVar already full.\n"); stg_exit(EXIT_FAILURE); } diff --git a/ghc/rts/Signals.c b/ghc/rts/Signals.c index 0953c3c..7214cb4 100644 --- a/ghc/rts/Signals.c +++ b/ghc/rts/Signals.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Signals.c,v 1.6 1999/06/25 09:16:46 simonmar Exp $ + * $Id: Signals.c,v 1.7 1999/07/14 13:39:46 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -39,21 +39,21 @@ more_handlers(I_ sig) I_ i; if (sig < nHandlers) - return; + return; if (handlers == NULL) - handlers = (I_ *) malloc((sig + 1) * sizeof(I_)); + handlers = (I_ *) malloc((sig + 1) * sizeof(I_)); else - handlers = (I_ *) realloc(handlers, (sig + 1) * sizeof(I_)); + handlers = (I_ *) realloc(handlers, (sig + 1) * sizeof(I_)); if (handlers == NULL) { - fflush(stdout); - fprintf(stderr, "VM exhausted (in more_handlers)\n"); - exit(EXIT_FAILURE); + /* don't fflush(stdout); WORKAROUND bug in Linux glibc */ + fprintf(stderr, "VM exhausted (in more_handlers)\n"); + exit(EXIT_FAILURE); } for(i = nHandlers; i <= sig; i++) - /* Fill in the new slots with default actions */ - handlers[i] = STG_SIG_DFL; + /* Fill in the new slots with default actions */ + handlers[i] = STG_SIG_DFL; nHandlers = sig + 1; } @@ -233,10 +233,10 @@ start_signal_handlers(void) StgInt sig_install(StgInt sig, StgInt spi, StgStablePtr handler, sigset_t *mask) { - fflush(stdout); - fprintf(stderr, - "No signal handling support in a parallel implementation.\n"); - exit(EXIT_FAILURE); + /* don't fflush(stdout); WORKAROUND bug in Linux glibc */ + fprintf(stderr, + "No signal handling support in a parallel implementation.\n"); + exit(EXIT_FAILURE); } void -- 1.7.10.4