changeset 98547:0835efd6ac19

(sys_signal): Always set SA_RESTART when noninteractively.
author Andreas Schwab <schwab@suse.de>
date Mon, 06 Oct 2008 21:27:44 +0000
parents dae1f13ca423
children 2c49cf36c498
files src/ChangeLog src/sysdep.c
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Oct 06 16:17:24 2008 +0000
+++ b/src/ChangeLog	Mon Oct 06 21:27:44 2008 +0000
@@ -1,3 +1,8 @@
+2008-10-06  Andreas Schwab  <schwab@suse.de>
+
+	* sysdep.c (sys_signal): Always set SA_RESTART when
+	noninteractively.
+
 2008-10-06  Chong Yidong  <cyd@stupidchicken.com>
 
 	* emacs.c (Vbefore_init_time, Vafter_init_time): Moved from
--- a/src/sysdep.c	Mon Oct 06 16:17:24 2008 +0000
+++ b/src/sysdep.c	Mon Oct 06 21:27:44 2008 +0000
@@ -2124,7 +2124,8 @@
   struct sigaction new_action, old_action;
   sigemptyset (&new_action.sa_mask);
   new_action.sa_handler = action;
-#if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART) && !defined(SYNC_INPUT)
+  new_action.sa_flags = 0;
+#if defined (SA_RESTART)
   /* Emacs mostly works better with restartable system services. If this
      flag exists, we probably want to turn it on here.
      However, on some systems this resets the timeout of `select'
@@ -2134,9 +2135,10 @@
      When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll
      for pending input so we need long-running syscalls to be interrupted
      after a signal that sets the interrupt_input_pending flag.  */
-  new_action.sa_flags = SA_RESTART;
-#else
-  new_action.sa_flags = 0;
+# if defined (BROKEN_SA_RESTART) || defined(SYNC_INPUT)
+  if (noninteractive)
+# endif
+    new_action.sa_flags = SA_RESTART;
 #endif
   sigaction (signal_number, &new_action, &old_action);
   return (old_action.sa_handler);