diff --git a/Userland/Libraries/LibC/regex.cpp b/Userland/Libraries/LibC/regex.cpp index f4ed51fc93..8bc2d3f92d 100644 --- a/Userland/Libraries/LibC/regex.cpp +++ b/Userland/Libraries/LibC/regex.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include @@ -22,12 +21,20 @@ static void ensure_libregex() { pthread_mutex_lock(&s_libregex_lock); if (!s_libregex) { - s_libregex = __dlopen("libregex.so", RTLD_NOW).value(); + s_libregex = dlopen("libregex.so", RTLD_NOW); + VERIFY(s_libregex); - s_regcomp = reinterpret_cast(__dlsym(s_libregex, "regcomp").value()); - s_regexec = reinterpret_cast(__dlsym(s_libregex, "regexec").value()); - s_regerror = reinterpret_cast(__dlsym(s_libregex, "regerror").value()); - s_regfree = reinterpret_cast(__dlsym(s_libregex, "regfree").value()); + s_regcomp = reinterpret_cast(dlsym(s_libregex, "regcomp")); + VERIFY(s_regcomp); + + s_regexec = reinterpret_cast(dlsym(s_libregex, "regexec")); + VERIFY(s_regexec); + + s_regerror = reinterpret_cast(dlsym(s_libregex, "regerror")); + VERIFY(s_regerror); + + s_regfree = reinterpret_cast(dlsym(s_libregex, "regfree")); + VERIFY(s_regerror); } pthread_mutex_unlock(&s_libregex_lock); }