mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
For MinGW, use native signal func in sigaction
For MinGW, there is a native signal function in UCRT. It handles a limited set of signals. * libguile/scmsigs.c (scm_sigaction_for_thread)[__MINGW32__]: removed (scm_sigaction_for_thread)[!__MINGW32__]: use for MinGW as well. For signals outside UCRT's native signal set, always return SIG_IGN.
This commit is contained in:
parent
70f434111b
commit
afda13e4ac
1 changed files with 7 additions and 20 deletions
|
@ -419,23 +419,6 @@ scm_sigaction (SCM signum, SCM handler, SCM flags)
|
|||
return scm_sigaction_for_thread (signum, handler, flags, SCM_UNDEFINED);
|
||||
}
|
||||
|
||||
#if __MINGW32__
|
||||
|
||||
SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
|
||||
(SCM signum, SCM handler, SCM flags, SCM thread),
|
||||
"sigaction stub")
|
||||
#define FUNC_NAME s_scm_sigaction_for_thread
|
||||
{
|
||||
(void) signum;
|
||||
(void) handler;
|
||||
(void) flags;
|
||||
(void) thread;
|
||||
return SCM_UNSPECIFIED;
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
#else /* !__MINGW32__ */
|
||||
|
||||
/* user interface for installation of signal handlers. */
|
||||
SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
|
||||
(SCM signum, SCM handler, SCM flags, SCM thread),
|
||||
|
@ -475,11 +458,17 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
|
|||
#endif
|
||||
int query_only = 0;
|
||||
int save_handler = 0;
|
||||
|
||||
|
||||
SCM old_handler;
|
||||
|
||||
csig = scm_to_signed_integer (signum, 0, NSIG-1);
|
||||
|
||||
#ifdef __MINGW32__
|
||||
if (csig != SIGINT && csig != SIGILL && csig != SIGFPE && csig != SIGSEGV
|
||||
&& csig != SIGTERM && csig != SIGBREAK && csig != SIGABRT)
|
||||
return scm_cons (scm_from_intptr_t ((intptr_t) SIG_IGN), scm_from_int (0));
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SIGACTION)
|
||||
action.sa_flags = 0;
|
||||
if (!SCM_UNBNDP (flags))
|
||||
|
@ -635,8 +624,6 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
|
|||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
#endif /* !__MINGW32__ */
|
||||
|
||||
SCM_DEFINE (scm_restore_signals, "restore-signals", 0, 0, 0,
|
||||
(void),
|
||||
"Return all signal handlers to the values they had before any call to\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue