[project @ 2001-04-02 16:10:32 by rrt]
[ghc-hetmet.git] / ghc / lib / std / cbits / writeError.c
index e948233..2072b69 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * (c) The GRASP/AQUA Project, Glasgow University, 1998
  *
- * $Id: writeError.c,v 1.2 1998/12/02 13:28:05 simonm Exp $
+ * $Id: writeError.c,v 1.5 2000/05/01 14:44:25 panne Exp $
  *
  * hPutStr Runtime Support
  */
@@ -17,8 +17,19 @@ implementation in one or two places.)
 */
 
 #include "Rts.h"
+#include "RtsUtils.h"
 #include "stgio.h"
 
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+StgAddr
+addrOf_ErrorHdrHook(void)
+{
+  return &ErrorHdrHook;
+}
+
 void
 writeErrString__ (msg_hdr, msg, len)
 StgAddr msg_hdr;
@@ -29,6 +40,8 @@ StgInt len;
   char* p  = (char*)msg;
   char  nl = '\n';
 
+  resetNonBlockingFd(2);
+
   /* Print error msg header */
   if (msg_hdr) {
     ((void (*)(int))msg_hdr)(2/*stderr*/);