Revert "gmodule-dl: Use RTLD_DEFAULT on FreeBSD too"

This reverts commit bb2ab2647d.

It appears to break the use of `G_MODULE_BIND_LOCAL`, as evidenced by
the `test_local_binding()` test in `module-test.c` failing on FreeBSD
ever since that test was added. See #3415.

Looking back at the merge request (!3656), I should have pressed for
detail on why this change was needed.

Fixes: #3415
This commit is contained in:
Philip Withnall 2024-08-20 14:36:29 +01:00
parent 23a7b4bf17
commit 82295998ac
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -167,7 +167,7 @@ _g_module_self (void)
* NULL is given, dlsym returns an appropriate pointer.
*/
lock_dlerror ();
#if defined(__ANDROID__) || defined(__NetBSD__) || defined(__FreeBSD__)
#if defined(__ANDROID__) || defined(__NetBSD__)
handle = RTLD_DEFAULT;
#else
handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY);
@ -182,7 +182,7 @@ _g_module_self (void)
static void
_g_module_close (gpointer handle)
{
#if defined(__ANDROID__) || defined(__NetBSD__) || defined(__FreeBSD__)
#if defined(__ANDROID__) || defined(__NetBSD__)
if (handle != RTLD_DEFAULT)
#endif
{