Ensure runhaskell is rebuild in stage2
[ghc-hetmet.git] / rts / RtsStartup.c
index 4f42823..0ce17fe 100644 (file)
@@ -499,7 +499,7 @@ hs_exit_(rtsBool wait_foreign)
     // Originally, this was in report_ccs_profiling().  Now, retainer
     // profiling might tack some extra stuff on to the end of this file
     // during endProfiling().
-    fclose(prof_file);
+    if (prof_file != NULL) fclose(prof_file);
 #endif
 
 #if defined(TICKY_TICKY)