diff --git a/quickjs-libc.c b/quickjs-libc.c index f9af760e3..063af571f 100644 --- a/quickjs-libc.c +++ b/quickjs-libc.c @@ -3115,7 +3115,7 @@ static js_once_t js_os_exec_once = JS_ONCE_INIT; static void js_os_exec_once_init(void) { - js_os_exec_closefrom = dlsym(RTLD_DEFAULT, "closefrom"); + *(void **) (&js_os_exec_closefrom) = dlsym(RTLD_DEFAULT, "closefrom"); } #endif