diff --git a/porting/linux/user/src/hook/musl_socket_preinit.c b/porting/linux/user/src/hook/musl_socket_preinit.c index b0a7f1887ea31e0725a7108763e0075884f781b0..af2849e193f2ea9c2c835a96acd63b2a0e807511 100644 --- a/porting/linux/user/src/hook/musl_socket_preinit.c +++ b/porting/linux/user/src/hook/musl_socket_preinit.c @@ -38,7 +38,7 @@ static void clear_socket_function() static void socket_finalize() { ((finalize_func_type)shared_lib_func[FINALIZE_FUNC])(); - __current_dispatch = NULL; + __current_dispatch = 0; __socket_hook_begin_flag = false; // Don't dlclose because hidumper crash } @@ -51,7 +51,7 @@ static bool finish_install_ohos_socket_hooks(const char* options) return false; } - int ret_value = atexit(socket_finalize); + atexit(socket_finalize); return true; } @@ -106,7 +106,7 @@ static void install_ohos_socket_hook() return; } - __current_dispatch = NULL; + __current_dispatch = 0; shared_library_handle = load_socket_hook_shared_library(); if (shared_library_handle == NULL) { return; @@ -116,7 +116,7 @@ static void install_ohos_socket_hook() __ohos_socket_hook_shared_library = (long long)shared_library_handle; __current_dispatch = (long long)(&__musl_libc_socket_dispatch); } else { - __ohos_socket_hook_shared_library = NULL; + __ohos_socket_hook_shared_library = 0; dlclose((void *)shared_library_handle); } }