diff options
author | Yusuke Endoh <[email protected]> | 2019-10-09 22:57:19 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2019-10-09 22:57:19 +0900 |
commit | b9cf58d2b2deca7d5b204080c2fe04d68cc50ab1 (patch) | |
tree | f2de3b05a7aae893b2625d3bc90a21c1d409f541 /signal.c | |
parent | 6f11c3b3354bef107f894f112ff7698414c7bae5 (diff) |
signal.c (ruby_abort): move the definition for refactoring
The three functions for fatal signals, sigbus, sigsegv, and sigill, are
a family. The definition of ruby_abort had interrupted them for no
reason. This change just moves the definition after the family.
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 35 |
1 files changed, 17 insertions, 18 deletions
@@ -937,24 +937,6 @@ sigbus(int sig SIGINFO_ARG) } #endif -#ifndef __sun -NORETURN(static void ruby_abort(void)); -#endif - -static void -ruby_abort(void) -{ -#ifdef __sun - /* Solaris's abort() is async signal unsafe. Of course, it is not - * POSIX compliant. - */ - raise(SIGABRT); -#else - abort(); -#endif - -} - #ifdef SIGSEGV NORETURN(static ruby_sigaction_t sigsegv); @@ -983,6 +965,23 @@ sigill(int sig SIGINFO_ARG) } #endif +#ifndef __sun +NORETURN(static void ruby_abort(void)); +#endif + +static void +ruby_abort(void) +{ +#ifdef __sun + /* Solaris's abort() is async signal unsafe. Of course, it is not + * POSIX compliant. + */ + raise(SIGABRT); +#else + abort(); +#endif +} + static void check_reserved_signal_(const char *name, size_t name_len) { |