Make Scheme only able to suspend itself if both stdin and stdout are
authorArthur Gleckler <edu/mit/csail/zurich/arthur>
Sat, 31 Aug 1991 03:59:26 +0000 (03:59 +0000)
committerArthur Gleckler <edu/mit/csail/zurich/arthur>
Sat, 31 Aug 1991 03:59:26 +0000 (03:59 +0000)
tty's and the "-emacs" option has not been given.

v7/src/microcode/uxsig.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index f107ccdbf097a97a5302a085a1346c5a9bc365c7..26a6b62599c747ba59a887b9143f851f2d3e3196 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.15 1991/08/26 15:00:22 arthur Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.16 1991/08/31 03:59:11 arthur Exp $
 
 Copyright (c) 1990-91 Massachusetts Institute of Technology
 
@@ -426,33 +426,38 @@ void
 DEFUN (stop_signal_default, (signo), int signo)
 {
 #ifdef HAVE_POSIX_SIGNALS
-  /* No need to handle systems without POSIX signals;
-     all job-control systems have them. */
-  sigset_t signo_mask;
-  sigset_t old_mask;
-  Tsignal_handler handler;
+  if ((isatty (STDIN_FILENO))
+      && (isatty (STDOUT_FILENO))
+      && (! option_emacs_subprocess))
+  {
+    /* No need to handle systems without POSIX signals;
+       all job-control systems have them. */
+    sigset_t signo_mask;
+    sigset_t old_mask;
+    Tsignal_handler handler;
 
-  /* Give the terminal back to the invoking process. */
-  OS_save_internal_state ();
-  OS_restore_external_state ();
+    /* Give the terminal back to the invoking process. */
+    OS_save_internal_state ();
+    OS_restore_external_state ();
 
-  /* Temporarily unbind this handler. */
-  handler = (current_handler (signo));
-  INSTALL_HANDLER (signo, SIG_DFL);
+    /* Temporarily unbind this handler. */
+    handler = (current_handler (signo));
+    INSTALL_HANDLER (signo, SIG_DFL);
 
-  /* Perform the default action for this signal. */
-  UX_sigemptyset (&signo_mask);
-  UX_sigaddset ((&signo_mask), signo);
-  UX_sigprocmask (SIG_UNBLOCK, (&signo_mask), (&old_mask));
-  UX_kill ((UX_getpid ()), signo);
-  UX_sigprocmask (SIG_SETMASK, (&old_mask), 0);
+    /* Perform the default action for this signal. */
+    UX_sigemptyset (&signo_mask);
+    UX_sigaddset ((&signo_mask), signo);
+    UX_sigprocmask (SIG_UNBLOCK, (&signo_mask), (&old_mask));
+    UX_kill ((UX_getpid ()), signo);
+    UX_sigprocmask (SIG_SETMASK, (&old_mask), 0);
 
-  /* Rebind this handler. */
-  INSTALL_HANDLER (signo, handler);
+    /* Rebind this handler. */
+    INSTALL_HANDLER (signo, handler);
 
-  /* Get the terminal back to its original state. */
-  OS_save_external_state ();
-  OS_restore_internal_state ();
+    /* Get the terminal back to its original state. */
+    OS_save_external_state ();
+    OS_restore_internal_state ();
+  }
 #endif /* HAVE_POSIX_SIGNALS */
 }
 
index 78c93de3b104eb4f6963ad6c73a323db960ca53b..cd5626caff4ba4bb8e8ae5e80a2c2479e85be203 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.96 1991/08/27 07:58:42 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.97 1991/08/31 03:59:26 arthur Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     96
+#define SUBVERSION     97
 #endif
index f0da89cf6719222470e2b4f62989228abd1e40e0..eddfb4278dd57c1e284b2778025ffc93265a0dce 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.96 1991/08/27 07:58:42 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.97 1991/08/31 03:59:26 arthur Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     96
+#define SUBVERSION     97
 #endif