[前][次][番号順一覧][スレッド一覧]

ruby-changes:58178

From: Yusuke <ko1@a...>
Date: Wed, 9 Oct 2019 23:23:03 +0900 (JST)
Subject: [ruby-changes:58178] b9cf58d2b2 (master): signal.c (ruby_abort): move the definition for refactoring

https://git.ruby-lang.org/ruby.git/commit/?id=b9cf58d2b2

From b9cf58d2b2deca7d5b204080c2fe04d68cc50ab1 Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Wed, 9 Oct 2019 22:57:19 +0900
Subject: 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.

diff --git a/signal.c b/signal.c
index 25f9540..7fc93bb 100644
--- a/signal.c
+++ b/signal.c
@@ -937,24 +937,6 @@ sigbus(int sig SIGINFO_ARG) https://github.com/ruby/ruby/blob/trunk/signal.c#L937
 }
 #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) https://github.com/ruby/ruby/blob/trunk/signal.c#L965
 }
 #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)
 {
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]