1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use the system getenv in setup_debug_log

As ruby_set_debug_option() is called before ruby_sysinit(),
CRITICAL_SECTIONs are not initialized yet.
This commit is contained in:
Nobuyoshi Nakada 2021-02-23 23:11:44 +09:00
parent 819dd464de
commit 7563d542d6
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 2 additions and 1 deletions

View file

@ -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.

View file

@ -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();
//