changeset 14127:ebaba7107594

(main): In batch mode, don't handle SIGHUP if was ignored. Block it while we decide what to do.
author Karl Heuer <kwzh@gnu.org>
date Tue, 09 Jan 1996 23:38:34 +0000
parents edc94b82c3b3
children 6b1ecb157b48
files src/emacs.c
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/emacs.c	Tue Jan 09 23:38:20 1996 +0000
+++ b/src/emacs.c	Tue Jan 09 23:38:34 1996 +0000
@@ -646,6 +646,22 @@
   init_signals ();
 #endif
 
+  /* Don't catch SIGHUP if dumping.  */
+  if (1
+#ifndef CANNOT_DUMP
+      && initialized
+#endif
+      )
+    {
+      sigblockx (SIGHUP);
+      /* In --batch mode, don't catch SIGHUP if already ignored.
+	 That makes nohup work.  */
+      if (! noninteractive
+	  || signal (SIGHUP, SIG_IGN) != SIG_IGN)
+	signal (SIGHUP, fatal_error_signal);
+      sigunblockx (SIGHUP);
+    }
+
   if (
 #ifndef CANNOT_DUMP
       ! noninteractive || initialized
@@ -654,10 +670,9 @@
 #endif
       )
     {
-      /* Don't catch these signals in batch mode if not initialized.
+      /* Don't catch these signals in batch mode if dumping.
 	 On some machines, this sets static data that would make
 	 signal fail to work right when the dumped Emacs is run.  */
-      signal (SIGHUP, fatal_error_signal);
       signal (SIGQUIT, fatal_error_signal);
       signal (SIGILL, fatal_error_signal);
       signal (SIGTRAP, fatal_error_signal);