commit 1c2b83c1fdb8ba523831bcdb63947f5f7a4cfa5e
parent f2391b5d58a9b9e7eef3cf9c2416ea6cca4ec5ca
Author: Landry Breuil <landry@openbsd.org>
Date: Sun, 16 Nov 2025 07:05:11 +0000
Bug 1999324 - dlopen("libnotify.so") on OpenBSD to fix notifications r=saschanaz
On OpenBSD, the library versioning is controled by the portstree, and
dlopen()/ld.so knows how to find the most recent version by being given no
suffix.
NSPR's pr_LoadLibrary() is patched on OpenBSD to cope (cf bug #650772) but that
doesn't work when dlopen() is used directly.
Differential Revision: https://phabricator.services.mozilla.com/D272518
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/toolkit/system/gnome/nsAlertsIconListener.cpp b/toolkit/system/gnome/nsAlertsIconListener.cpp
@@ -114,7 +114,11 @@ nsAlertsIconListener::nsAlertsIconListener(
mBackend(aBackend),
mAlertNotification(aAlertNotification) {
if (!libNotifyHandle && !libNotifyNotAvail) {
+#ifdef __OpenBSD__
+ libNotifyHandle = dlopen("libnotify.so", RTLD_LAZY);
+#else
libNotifyHandle = dlopen("libnotify.so.4", RTLD_LAZY);
+#endif
if (!libNotifyHandle) {
libNotifyHandle = dlopen("libnotify.so.1", RTLD_LAZY);
if (!libNotifyHandle) {