Fix for Kdbus-disabled Profiles to avoid busname parsing
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 6 Oct 2016 09:40:08 +0000 (11:40 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 26 Jan 2024 16:49:49 +0000 (17:49 +0100)
Change-Id: Id45193adf624d60fc3bfbda09c4f6c357ff90e2a

src/core/busname.c

index 730be2e..278afd0 100644 (file)
@@ -998,7 +998,12 @@ static int busname_get_timeout(Unit *u, usec_t *timeout) {
 }
 
 static bool busname_supported(void) {
-        return false;
+        static int supported = -1;
+
+        if (supported < 0)
+                supported = access("/sys/fs/kdbus", F_OK) >= 0;
+
+        return supported;
 }
 
 static int busname_control_pid(Unit *u) {