Only uninstall signal handlers if they were actually installed (#9068)
authorSimon Marlow <marlowsd@gmail.com>
Wed, 14 May 2014 20:10:06 +0000 (21:10 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 16 May 2014 08:52:48 +0000 (09:52 +0100)
Submitted by: tomgr

rts/RtsStartup.c

index aa7306f..15e48a6 100644 (file)
@@ -355,8 +355,12 @@ hs_exit_(rtsBool wait_foreign)
     resetTerminalSettings();
 #endif
 
-    // uninstall signal handlers
-    resetDefaultHandlers();
+#if defined(RTS_USER_SIGNALS)
+    if (RtsFlags.MiscFlags.install_signal_handlers) {
+        // uninstall signal handlers
+        resetDefaultHandlers();
+    }
+#endif
 
     /* stop timing the shutdown, we're about to print stats */
     stat_endExit();