changeset 1373:cea4101a2f18

[project @ 1995-09-07 07:19:58 by jwe]
author jwe
date Thu, 07 Sep 1995 07:19:58 +0000
parents 6d79fce68412
children 674a17e1dbab
files src/sighandlers.cc
diffstat 1 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/sighandlers.cc	Wed Sep 06 22:22:06 1995 +0000
+++ b/src/sighandlers.cc	Thu Sep 07 07:19:58 1995 +0000
@@ -36,6 +36,7 @@
 #endif
 
 #include "error.h"
+#include "load-save.h"
 #include "octave.h"
 #include "sighandlers.h"
 #include "syswait.h"
@@ -52,6 +53,9 @@
 my_friendly_exit (const char *sig_name, int sig_number)
 {
   error ("%s -- stopping myself...", sig_name);
+
+  save_user_variables ();
+
   clean_up_and_exit (sig_number);
 }
 
@@ -117,6 +121,31 @@
 }
 #endif
 
+#if defined (__alpha__)
+static RETSIGTYPE
+sigfpe_handler (int i)
+{
+  // Can this ever cause trouble on systems that don't forget signal
+  // handlers when they are invoked?
+
+  signal (SIGFPE, sigfpe_handler);
+
+  error ("floating point exception -- trying to continue");
+
+  if (can_interrupt)
+    {
+      jump_to_top_level ();
+      panic_impossible ();
+    }
+
+#if RETSIGTYPE == void
+  return;
+#else
+  return 0;
+#endif
+}
+#endif
+
 // Handle SIGINT by restarting the parser (see octave.cc).
 
 // XXX FIXME XXX -- it would probably be good to try to use POSIX
@@ -196,8 +225,12 @@
 #endif
 
 #ifdef SIGFPE
+#if defined (__alpha__)
+  signal (SIGFPE, sigfpe_handler);
+#else
   signal (SIGFPE, generic_sig_handler);
 #endif
+#endif
 
 #ifdef SIGHUP
   signal (SIGHUP, generic_sig_handler);