changeset 56695:62660593b0a2

(process_send_signal) [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: Clean up. Do nothing if the character is CVDISABLE.
author Richard M. Stallman <rms@gnu.org>
date Mon, 16 Aug 2004 22:57:26 +0000
parents d5801cbd92f5
children fb72da59e269
files src/process.c
diffstat 1 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Mon Aug 16 22:53:28 2004 +0000
+++ b/src/process.c	Mon Aug 16 22:57:26 2004 +0000
@@ -5549,29 +5549,32 @@
          work.  If the system has it, use it.  */
 #ifdef HAVE_TERMIOS
       struct termios t;
+      cc_t *sig_char = NULL;
+
+      tcgetattr (XINT (p->infd), &t);
 
       switch (signo)
 	{
 	case SIGINT:
-	  tcgetattr (XINT (p->infd), &t);
-	  send_process (proc, &t.c_cc[VINTR], 1, Qnil);
-	  return;
+	  sig_char = &t.c_cc[VINTR];
+	  break;
 
 	case SIGQUIT:
-	  tcgetattr (XINT (p->infd), &t);
-  	  send_process (proc, &t.c_cc[VQUIT], 1, Qnil);
-  	  return;
+	  sig_char = &t.c_cc[VQUIT];
+	  break;
 
   	case SIGTSTP:
-	  tcgetattr (XINT (p->infd), &t);
 #if defined (VSWTCH) && !defined (PREFER_VSUSP)
-  	  send_process (proc, &t.c_cc[VSWTCH], 1, Qnil);
+	  sig_char = &t.c_cc[VSWTCH];
 #else
-	  send_process (proc, &t.c_cc[VSUSP], 1, Qnil);
-#endif
-  	  return;
+	  sig_char = &t.c_cc[VSUSP];
+#endif
+	  break;
 	}
 
+      if (sig_char && *sig_char != CVDISABLE)
+	send_process (proc, sig_char, 1, Qnil);
+      return;
 #else /* ! HAVE_TERMIOS */
 
       /* On Berkeley descendants, the following IOCTL's retrieve the