diff src/sysdep.cc @ 5770:6a9244f89a2a

[project @ 2006-04-18 17:44:33 by jwe]
author jwe
date Tue, 18 Apr 2006 17:44:33 +0000
parents ec44bd0917fe
children ace8d8d26933
line wrap: on
line diff
--- a/src/sysdep.cc	Tue Apr 18 15:57:06 2006 +0000
+++ b/src/sysdep.cc	Tue Apr 18 17:44:33 2006 +0000
@@ -83,6 +83,7 @@
 #include "oct-obj.h"
 #include "ov.h"
 #include "pager.h"
+#include "sighandlers.h"
 #include "sysdep.h"
 #include "toplev.h"
 #include "utils.h"
@@ -417,11 +418,23 @@
 #else
   raw_mode (true, wait);
 
+  // Get current handler.
+  octave_interrupt_handler saved_interrupt_handler
+    = octave_ignore_interrupts ();
+
+  // Restore it, disabling system call restarts (if possible) so the
+  // read can be interrupted.
+
+  octave_set_interrupt_handler (saved_interrupt_handler, false);
+
   int c = std::cin.get ();
-
+ 
   if (std::cin.fail () || std::cin.eof ())
     std::cin.clear ();
 
+  // Restore it, enabling system call restarts (if possible).
+  octave_set_interrupt_handler (saved_interrupt_handler, true);
+
   raw_mode (false, true);
 #endif