summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'process.c')
-rw-r--r--process.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/process.c b/process.c
index 612d319947..3a0616d6e3 100644
--- a/process.c
+++ b/process.c
@@ -331,6 +331,9 @@ static ID id_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID;
static ID id_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC;
#endif
static ID id_hertz;
+#ifdef HAVE_GETADDRINFO_A
+void (* rb_socket_before_exec_func)() = NULL;
+#endif
/* execv and execl are async-signal-safe since SUSv4 (POSIX.1-2008, XPG7) */
#if defined(__sun) && !defined(_XPG7) /* Solaris 10, 9, ... */
@@ -1545,6 +1548,13 @@ before_exec_async_signal_safe(void)
static void
before_exec_non_async_signal_safe(void)
{
+#ifdef HAVE_GETADDRINFO_A
+ if (rb_socket_before_exec_func) {
+ /* A mitigation for [Bug #17220]. See ext/socket/raddrinfo.c */
+ rb_socket_before_exec_func();
+ }
+#endif
+
/*
* On Mac OS X 10.5.x (Leopard) or earlier, exec() may return ENOTSUP
* if the process have multiple threads. Therefore we have to kill