diff src/signal.c @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents ca9a9ec9c1c1
children 90d73dddcdc4
line wrap: on
line diff
--- a/src/signal.c	Mon Aug 13 10:29:43 2007 +0200
+++ b/src/signal.c	Mon Aug 13 10:30:37 2007 +0200
@@ -63,7 +63,7 @@
 int poll_for_quit_id;
 #endif
 
-#ifndef SIGCHLD
+#if defined(HAVE_UNIX_PROCESSES) && !defined(SIGCHLD)
 int poll_for_sigchld_id;
 #endif
 
@@ -552,7 +552,7 @@
 #endif /* not SIGIO and not DONT_POLL_FOR_QUIT */
 }
 
-#ifndef SIGCHLD
+#if defined(HAVE_UNIX_PROCESSES) && !defined(SIGCHLD)
 
 static void
 init_poll_for_sigchld (void)
@@ -640,9 +640,17 @@
       /* Don't catch these signals in batch mode if not initialized.
 	 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);
+#ifdef SIGHUP
+      /* If we've been nohup'ed, keep it that way.  */
+      if (signal (SIGHUP,  fatal_error_signal) == SIG_IGN)
+	signal (SIGHUP, SIG_IGN);
+#endif
+#ifdef SIGQUIT
       signal (SIGQUIT, fatal_error_signal);
+#endif
+#ifdef SIGILL
       signal (SIGILL,  fatal_error_signal);
+#endif
 #ifdef SIGTRAP
       signal (SIGTRAP, fatal_error_signal);
 #endif
@@ -770,7 +778,7 @@
 #endif
     }
 
-#ifndef SIGCHLD
+#if defined(HAVE_UNIX_PROCESSES) && !defined(SIGCHLD)
   init_poll_for_sigchld ();
 #endif