removed moo_ignore_termreq()

This commit is contained in:
hyunghwan.chung 2018-12-04 03:34:54 +00:00
parent e2593e00c6
commit cd5284e65f
3 changed files with 13 additions and 24 deletions

View File

@ -33,6 +33,10 @@
#include <stdlib.h>
#include <locale.h>
#if (defined(__unix) || defined(__linux) || defined(__ultrix) || defined(_AIX) || defined(__hpux) || defined(__sgi)) && defined(HAVE_SIGNAL_H)
# include <signal.h>
#endif
static void print_syntax_error (moo_t* moo, const char* main_src_file)
{
moo_synerr_t synerr;
@ -274,6 +278,13 @@ int main (int argc, char* argv[])
MOO_DEBUG0 (moo, "COMPILE OK. STARTING EXECUTION...\n");
xret = 0;
#if defined(SIGINT) && defined(HAVE_SIGNAL)
/* i'd like the program to ignore the interrupt signal
* before moo_catch_termreq() and after moo_uncatch_termreq() */
signal (SIGINT, SIG_IGN);
signal (SIGTERM, SIG_IGN);
#endif
moo_catch_termreq ();
moo_start_ticker ();

View File

@ -93,10 +93,6 @@ MOO_EXPORT void moo_uncatch_termreq (
void
);
MOO_EXPORT void moo_ignore_termreq (
void
);
/* ----------------------------------------------------------------------- */
MOO_EXPORT moo_t* moo_openstd (
moo_oow_t xtnsize,

View File

@ -3698,11 +3698,6 @@ void moo_uncatch_termreq (void)
SetConsoleCtrlHandler (handle_term, FALSE);
}
void moo_ignore_termreq (void)
{
/* TODO: ... */
}
#elif defined(__OS2__)
static EXCEPTIONREGISTRATIONRECORD os2_excrr = { 0 };
@ -3738,11 +3733,6 @@ void moo_uncatch_termreq (void)
DosUnsetExceptionHandler (&os2_excrr);
}
void moo_ignore_termreq (void)
{
/* TODO: ... */
}
#elif defined(__DOS__)
#if defined(_INTELC32_)
@ -3779,26 +3769,18 @@ void moo_uncatch_termreq (void)
_dos_setvect (0x23, dos_int23_handler);
}
void moo_ignore_termreq (void)
{
/* TODO: */
}
#else
void moo_catch_termreq (void)
{
set_signal_handler(SIGTERM, abort_all_moos, 0);
set_signal_handler(SIGINT, abort_all_moos, 0);
}
void moo_uncatch_termreq (void)
{
unset_signal_handler(SIGTERM);
}
void moo_ignore_termreq (void)
{
set_signal_handler(SIGINT, SIG_IGN, 0);
unset_signal_handler(SIGINT);
}
#endif