Make __wups_getreent a bit more robust

This commit is contained in:
Maschell 2026-02-25 18:58:08 +01:00
parent 13fd64a70d
commit b4df609fa8

View File

@ -55,7 +55,11 @@ __wups_thread_cleanup(OSThread *thread,
}
struct _reent *
__wups_getreent(void) {
__wups_getreent() {
if (!wut_get_thread_specific || !wut_set_thread_specific || OSGetCurrentThread() == nullptr) {
return _GLOBAL_REENT;
}
struct __wups_thread_context *context;
context = (struct __wups_thread_context *) wut_get_thread_specific(__WUPS_CONTEXT_THREAD_SPECIFIC_ID);