From 1863bde916640d51a1c124e691a010437d2d2dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 30 May 2024 08:45:14 +0800 Subject: [PATCH] InitSystem: better systemd version detection --- src/detection/initsystem/initsystem_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detection/initsystem/initsystem_linux.c b/src/detection/initsystem/initsystem_linux.c index 0a93b0ca7..b518db21d 100644 --- a/src/detection/initsystem/initsystem_linux.c +++ b/src/detection/initsystem/initsystem_linux.c @@ -20,7 +20,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) if (ffStrbufEqualS(&result->name, "systemd")) { if (ffProcessAppendStdOut(&result->version, (char* const[]) { - result->exe.chars, // use exe path in case users have another systemd installed + ffStrbufEndsWithS(&result->exe, "/systemd") ? result->exe.chars : "systemctl", // use exe path in case users have another systemd installed "--version", NULL, }) == NULL && result->version.length)