summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-02-23 23:11:44 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-02-23 23:11:44 +0900
commit7563d542d6c2bba5f5820f45b9707583aa28b136 (patch)
treeffa62f126f49d671f015d5cb70b954a9177e4544
parent819dd464dee2245299cb62323fe5c2b42940879e (diff)
Use the system getenv in setup_debug_log
As ruby_set_debug_option() is called before ruby_sysinit(), CRITICAL_SECTIONs are not initialized yet.
-rw-r--r--debug.c1
-rw-r--r--win32/win32.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/debug.c b/debug.c
index 75d4cc6569..e0ff94886b 100644
--- a/debug.c
+++ b/debug.c
@@ -263,6 +263,7 @@ ruby_set_debug_option(const char *str)
}
#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 bb7471fbaf..9303a17607 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -811,7 +811,6 @@ StartSockets(void)
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)
#endif
SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOGPFAULTERRORBOX);
+ InitializeCriticalSection(&uenvarea_mutex);
get_version();
//