From: Jay Krell Date: Thu, 24 Oct 2019 21:44:57 +0000 (-0700) Subject: Include signal.h unconditionally. (mono/mono#17430) X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~289 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e94be20a49da9d95ee168d8db945c456338c7262;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Include signal.h unconditionally. (mono/mono#17430) Some of the includes already were unconditional, including both on Win32 and Unix. It is part of ANSI C 89, albeit in a reduced form compared to typical Unix (no sigaction). Remove configuration of MSG_NOSIGNAL which has no other uses. Preserve configuration of signal.h temporarily due to other uses of ifdef HAVE_SIGNAL_H. i.e. LLVM? Commit migrated from https://github.com/mono/mono/commit/fc390a5f2493ae908ccf2696c4ca675d82104db6 --- diff --git a/src/mono/configure.ac b/src/mono/configure.ac index 5936374..b5384c2 100644 --- a/src/mono/configure.ac +++ b/src/mono/configure.ac @@ -2361,21 +2361,6 @@ if test x$host_win32 = xno; then AC_CHECK_LIB(inotify, inotify_init, LIBS="$LIBS -linotify") esac - dnl ******************************* - dnl *** Checks for MSG_NOSIGNAL *** - dnl ******************************* - AC_MSG_CHECKING(for MSG_NOSIGNAL) - AC_TRY_COMPILE([#include ], [ - int f = MSG_NOSIGNAL; - ], [ - # Yes, we have it... - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Have MSG_NOSIGNAL]) - ], [ - # We'll have to use signals - AC_MSG_RESULT(no) - ]) - dnl ***************************** dnl *** Checks for IPPROTO_IP *** dnl ***************************** diff --git a/src/mono/mono/metadata/metadata-verify.c b/src/mono/mono/metadata/metadata-verify.c index eaa22e1..321258e 100644 --- a/src/mono/mono/metadata/metadata-verify.c +++ b/src/mono/mono/metadata/metadata-verify.c @@ -32,7 +32,6 @@ #include #include #include -//#include #include #ifndef DISABLE_VERIFIER diff --git a/src/mono/mono/metadata/threads.c b/src/mono/mono/metadata/threads.c index e8ebd02..1d1f11f 100644 --- a/src/mono/mono/metadata/threads.c +++ b/src/mono/mono/metadata/threads.c @@ -64,9 +64,7 @@ #include #endif -#ifdef HAVE_SIGNAL_H #include -#endif #if defined(HOST_WIN32) #include @@ -6385,7 +6383,6 @@ summarizer_state_init (SummarizerGlobalState *state, MonoNativeThreadId current, static void summarizer_signal_other_threads (SummarizerGlobalState *state, MonoNativeThreadId current, int current_idx) { -#ifdef HAVE_SIGNAL_H sigset_t sigset, old_sigset; sigemptyset(&sigset); sigaddset(&sigset, SIGTERM); @@ -6404,7 +6401,6 @@ summarizer_signal_other_threads (SummarizerGlobalState *state, MonoNativeThreadI g_error ("pthread_kill () is not supported by this platform"); #endif } -#endif } // Returns true when there are shared global references to "this_thread" diff --git a/src/mono/mono/metadata/w32process-unix.c b/src/mono/mono/metadata/w32process-unix.c index ddf251b..14559fd 100644 --- a/src/mono/mono/metadata/w32process-unix.c +++ b/src/mono/mono/metadata/w32process-unix.c @@ -22,9 +22,7 @@ #include #include #include -#ifdef HAVE_SIGNAL_H #include -#endif #include #include #ifdef HAVE_SYS_PARAM_H diff --git a/src/mono/mono/metadata/w32socket-unix.c b/src/mono/mono/metadata/w32socket-unix.c index bd5baf3..5822ee7 100644 --- a/src/mono/mono/metadata/w32socket-unix.c +++ b/src/mono/mono/metadata/w32socket-unix.c @@ -42,9 +42,7 @@ #ifdef HAVE_SYS_SOCKIO_H #include /* defines SIOCATMARK */ #endif -#ifndef HAVE_MSG_NOSIGNAL #include -#endif #ifdef HAVE_SYS_SENDFILE_H #include #endif diff --git a/src/mono/mono/mini/driver.c b/src/mono/mono/mini/driver.c index 06db626..cce7f34 100644 --- a/src/mono/mono/mini/driver.c +++ b/src/mono/mono/mini/driver.c @@ -12,9 +12,7 @@ */ #include -#ifdef HAVE_SIGNAL_H #include -#endif #if HAVE_SCHED_SETAFFINITY #include #endif diff --git a/src/mono/mono/mini/exceptions-amd64.c b/src/mono/mono/mini/exceptions-amd64.c index d5ff063..88224bd 100644 --- a/src/mono/mono/mini/exceptions-amd64.c +++ b/src/mono/mono/mini/exceptions-amd64.c @@ -20,10 +20,7 @@ #include #include - -#ifdef HAVE_SIGNAL_H #include -#endif #ifdef HAVE_UCONTEXT_H #include #endif diff --git a/src/mono/mono/mini/mini-amd64.h b/src/mono/mono/mini/mini-amd64.h index c5aa259..6f17a901 100644 --- a/src/mono/mono/mini/mini-amd64.h +++ b/src/mono/mono/mini/mini-amd64.h @@ -12,10 +12,7 @@ #ifdef HOST_WIN32 #include -/* use SIG* defines if possible */ -#ifdef HAVE_SIGNAL_H #include -#endif #if !defined(_MSC_VER) /* sigcontext surrogate */ @@ -26,7 +23,7 @@ struct sigcontext { guint64 edx; guint64 ebp; guint64 esp; - guint64 esi; + guint64 esi; guint64 edi; guint64 eip; }; diff --git a/src/mono/mono/mini/mini-exceptions.c b/src/mono/mono/mini/mini-exceptions.c index 1f583c8..b00db6f 100644 --- a/src/mono/mono/mini/mini-exceptions.c +++ b/src/mono/mono/mini/mini-exceptions.c @@ -15,10 +15,7 @@ #include #include #include - -#ifdef HAVE_SIGNAL_H #include -#endif #ifdef HAVE_EXECINFO_H #include diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index f05af55..4887061 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -23,9 +23,7 @@ #ifdef HAVE_SYS_TIME_H #include #endif -#ifdef HAVE_SIGNAL_H #include -#endif #include diff --git a/src/mono/mono/mini/mini-x86.h b/src/mono/mono/mini/mini-x86.h index d64c37f..6791b57 100644 --- a/src/mono/mono/mini/mini-x86.h +++ b/src/mono/mono/mini/mini-x86.h @@ -11,10 +11,7 @@ #ifdef HOST_WIN32 #include -/* use SIG* defines if possible */ -#ifdef HAVE_SIGNAL_H #include -#endif typedef void MONO_SIG_HANDLER_SIGNATURE ((*MonoW32ExceptionHandler)); diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h index 9d6dd04..db89b70 100644 --- a/src/mono/mono/mini/mini.h +++ b/src/mono/mono/mini/mini.h @@ -10,9 +10,7 @@ #include "config.h" #include -#ifdef HAVE_SIGNAL_H #include -#endif #ifdef HAVE_SYS_TYPES_H #include #endif diff --git a/src/mono/mono/utils/mono-context.h b/src/mono/mono/utils/mono-context.h index dda6b86..696c0df 100644 --- a/src/mono/mono/utils/mono-context.h +++ b/src/mono/mono/utils/mono-context.h @@ -14,10 +14,7 @@ #include "mono-compiler.h" #include "mono-sigcontext.h" #include "mono-machine.h" - -#ifdef HAVE_SIGNAL_H #include -#endif #define MONO_CONTEXT_OFFSET(field, index, field_type) \ "i" (offsetof (MonoContext, field) + (index) * sizeof (field_type)) diff --git a/src/mono/mono/utils/mono-mmap-wasm.c b/src/mono/mono/utils/mono-mmap-wasm.c index 10485f7..c8ff1f8 100644 --- a/src/mono/mono/utils/mono-mmap-wasm.c +++ b/src/mono/mono/utils/mono-mmap-wasm.c @@ -13,9 +13,7 @@ #ifdef HAVE_SYS_SYSCTL_H #include #endif -#ifdef HAVE_SIGNAL_H #include -#endif #include #include #include diff --git a/src/mono/mono/utils/mono-mmap.c b/src/mono/mono/utils/mono-mmap.c index 3be70d9..174b154 100644 --- a/src/mono/mono/utils/mono-mmap.c +++ b/src/mono/mono/utils/mono-mmap.c @@ -22,9 +22,7 @@ #ifdef HAVE_SYS_SYSCTL_H #include #endif -#ifdef HAVE_SIGNAL_H #include -#endif #include #include #include diff --git a/src/mono/mono/utils/mono-sigcontext.h b/src/mono/mono/utils/mono-sigcontext.h index 254d7ab..b23b706 100644 --- a/src/mono/mono/utils/mono-sigcontext.h +++ b/src/mono/mono/utils/mono-sigcontext.h @@ -18,9 +18,7 @@ #include #endif -#ifdef HAVE_SIGNAL_H #include -#endif #if defined(TARGET_X86)