From ee9836c5e78a9b52a5265e6ec4156a025fb6a1a6 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 4 Aug 2020 09:40:39 +0100 Subject: [PATCH] elput - support libelogind.so.0 as well as libelogind-shared.so.0 for gentoo... @fix --- src/lib/elput/elput_logind.c | 41 ++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c index 09aeece0ec..5182aefdbe 100644 --- a/src/lib/elput/elput_logind.c +++ b/src/lib/elput/elput_logind.c @@ -37,13 +37,42 @@ _elput_sd_init(void) } if (!_libsystemd) { - _libsystemd = eina_module_new("libelogind-shared.so.0"); - if (_libsystemd) + const char *s = getenv("EFL_ELOGIND_LIB"); + + if (s) { - if (!eina_module_load(_libsystemd)) + _libsystemd = eina_module_new(s); + if (_libsystemd) { - eina_module_free(_libsystemd); - _libsystemd = NULL; + if (!eina_module_load(_libsystemd)) + { + eina_module_free(_libsystemd); + _libsystemd = NULL; + } + } + } + if (!_libsystemd) + { + _libsystemd = eina_module_new("libelogind-shared.so.0"); + if (_libsystemd) + { + if (!eina_module_load(_libsystemd)) + { + eina_module_free(_libsystemd); + _libsystemd = NULL; + } + } + } + if (!_libsystemd) + { + _libsystemd = eina_module_new("libelogind.so.0"); + if (_libsystemd) + { + if (!eina_module_load(_libsystemd)) + { + eina_module_free(_libsystemd); + _libsystemd = NULL; + } } } } @@ -52,7 +81,7 @@ _elput_sd_init(void) _libsystemd_broken = EINA_TRUE; return; } - // sd_session_get_vt == newere in systemd 207 + // sd_session_get_vt == newer in systemd 207 _elput_sd_session_get_vt = eina_module_symbol_get(_libsystemd, "sd_session_get_vt"); // sd_session_get_tty == older api in ssystemd 198