diff --git a/src/detection/initsystem/initsystem_linux.c b/src/detection/initsystem/initsystem_linux.c index 6776ef758..dbce8bda8 100644 --- a/src/detection/initsystem/initsystem_linux.c +++ b/src/detection/initsystem/initsystem_linux.c @@ -48,7 +48,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) if (instance.config.general.detectVersion) { - #if __linux__ && !__ANDROID__ + #if (defined(__linux__) && !defined(__ANDROID__)) || defined(__GNU__) if (ffStrbufEqualS(&result->name, "systemd")) { ffBinaryExtractStrings(result->exe.chars, extractSystemdVersion, &result->version, (uint32_t) strlen("systemd 0.0 running in x")); @@ -84,6 +84,20 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) ffStrbufSubstrAfterLastC(&result->version, ' '); } } + else if (ffStrbufEqualS(&result->name, "guile")) + { + /* TODO: guile is actually shepherd */ + if (ffProcessAppendStdOut(&result->version, (char* const[]) { + ffStrbufEndsWithS(&result->exe, "/guile") ? result->exe.chars : "guile", + "--version", + NULL, + }) == NULL && result->version.length) + { + /* guile (GNU Guile) 3.0.9 */ + ffStrbufSubstrBeforeFirstC(&result->version, '\n'); + ffStrbufSubstrAfterLastC(&result->version, ' '); + } + } #elif __APPLE__ if (ffStrbufEqualS(&result->name, "launchd")) {