ruby-changes:65330
From: Nobuyoshi <ko1@a...>
Date: Tue, 23 Feb 2021 23:13:41 +0900 (JST)
Subject: [ruby-changes:65330] 7563d542d6 (master): Use the system getenv in setup_debug_log
https://git.ruby-lang.org/ruby.git/commit/?id=7563d542d6 From 7563d542d6c2bba5f5820f45b9707583aa28b136 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 23 Feb 2021 23:11:44 +0900 Subject: Use the system getenv in setup_debug_log As ruby_set_debug_option() is called before ruby_sysinit(), CRITICAL_SECTIONs are not initialized yet. --- debug.c | 1 + win32/win32.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debug.c b/debug.c index 75d4cc6..e0ff948 100644 --- a/debug.c +++ b/debug.c @@ -263,6 +263,7 @@ ruby_set_debug_option(const char *str) https://github.com/ruby/ruby/blob/trunk/debug.c#L263 } #if RUBY_DEVEL +#undef getenv // RUBY_DEBUG_LOG features // See vm_debug.h comments for details. diff --git a/win32/win32.c b/win32/win32.c index bb7471f..9303a17 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -811,7 +811,6 @@ StartSockets(void) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L811 InitializeCriticalSection(&select_mutex); InitializeCriticalSection(&socklist_mutex); InitializeCriticalSection(&conlist_mutex); - InitializeCriticalSection(&uenvarea_mutex); atexit(exit_handler); } @@ -896,6 +895,7 @@ rb_w32_sysinit(int *argc, char ***argv) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L895 #endif SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOGPFAULTERRORBOX); + InitializeCriticalSection(&uenvarea_mutex); get_version(); // -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/