diff src/pager.cc @ 2795:14d07e4a0265

[project @ 1997-03-07 02:18:49 by jwe]
author jwe
date Fri, 07 Mar 1997 02:21:37 +0000
parents 18395aaeafb7
children 8b262e771614
line wrap: on
line diff
--- a/src/pager.cc	Thu Mar 06 09:45:51 1997 +0000
+++ b/src/pager.cc	Fri Mar 07 02:21:37 1997 +0000
@@ -105,21 +105,12 @@
     {
       if (WIFEXITED (status) || WIFSIGNALLED (status))
 	{
-	  if (external_pager)
-	    clear_external_pager ();
-
-	  // Don't call error() here because we don't want to set
-	  // the error state.
+	  // Avoid warning() or error(), since that will put us back in
+	  // the pager, which would be bad news.
 
-	  // XXX FIXME XXX -- something is wrong with the way that
-	  // we are cleaning up the pager in the event of a SIGCHLD.
-	  // If this message is printed with warning(), we eventually
-	  // crash.
-
-	  cout << "warning: connection to external pager (pid = "
-	       << pid << ") lost --" << endl
-	       << "warning: pending computations and output may be lost"
-	       << endl;
+	  cerr << "warning: connection to external pager (pid = "
+	       << pid << ") lost --\n"
+	       << "warning: attempting to finish pending computations...\n";
 	}
     }
 }
@@ -172,6 +163,18 @@
 		      && external_pager->good ())
 		    external_pager->flush ();
 		}
+	      else
+		{
+		  // We had a pager, but it must have died.  Restore
+		  // the interrupt state so we can escape back to the
+		  // prompt if there are lots of computations pending.
+
+		  if (interrupt_handler_saved)
+		    {
+		      octave_set_interrupt_handler (saved_interrupt_handler);
+		      interrupt_handler_saved = false;
+		    }
+		}
 	    }
 	  else
 	    {