+Tue Apr 25 09:39:46 2006 Ben Pfaff <blp@gnu.org>
+
+ * main.c: (terminate) Mark static and NO_RETURN. If called
+ recursively, which can only happen via signal, just exit instead
+ of trying to gracefully shut down.
+
Fri Mar 31 10:33:37 2006 Ben Pfaff <blp@gnu.org>
* command-line.c: (var pre_syntax_message) -d and -u are no longer
static void fpu_init (void);
static void handle_error (int code);
static int execute_command (void);
+static void terminate (bool success) NO_RETURN;
/* If a segfault happens, issue a message to that effect and halt */
void bug_handler(int sig);
/* Handle quit/term/int signals */
void interrupt_handler(int sig);
-void terminate (bool success);
/* Program entry point. */
int
}
terminate (err_error_count == 0);
- abort ();
}
/* Parse and execute a command, returning its return code. */
/* Terminate PSPP. SUCCESS should be true to exit successfully,
false to exit as a failure. */
-void
+static void
terminate (bool success)
{
static bool terminating = false;
- if (terminating)
- return;
- terminating = true;
-
- msg_done ();
- outp_done ();
+ if (!terminating)
+ {
+ terminating = true;
- cancel_transformations ();
- dict_destroy (default_dict);
+ msg_done ();
+ outp_done ();
- random_done ();
- settings_done ();
- fh_done ();
- lex_done ();
- getl_uninitialize ();
+ cancel_transformations ();
+ dict_destroy (default_dict);
+ random_done ();
+ settings_done ();
+ fh_done ();
+ lex_done ();
+ getl_uninitialize ();
+ readln_uninitialize ();
+ }
exit (success ? EXIT_SUCCESS : EXIT_FAILURE);
}