Skip to content

Commit d553bc4

Browse files
yelnineiCarterLi
authored andcommitted
WIP: shepherd initsystem
1 parent add2bfd commit d553bc4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/detection/initsystem/initsystem_linux.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
4848

4949
if (instance.config.general.detectVersion)
5050
{
51-
#if __linux__ && !__ANDROID__
51+
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(__GNU__)
5252
if (ffStrbufEqualS(&result->name, "systemd"))
5353
{
5454
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)
8484
ffStrbufSubstrAfterLastC(&result->version, ' ');
8585
}
8686
}
87+
else if (ffStrbufEqualS(&result->name, "guile"))
88+
{
89+
/* TODO: guile is actually shepherd */
90+
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
91+
ffStrbufEndsWithS(&result->exe, "/guile") ? result->exe.chars : "guile",
92+
"--version",
93+
NULL,
94+
}) == NULL && result->version.length)
95+
{
96+
/* guile (GNU Guile) 3.0.9 */
97+
ffStrbufSubstrBeforeFirstC(&result->version, '\n');
98+
ffStrbufSubstrAfterLastC(&result->version, ' ');
99+
}
100+
}
87101
#elif __APPLE__
88102
if (ffStrbufEqualS(&result->name, "launchd"))
89103
{

0 commit comments

Comments
 (0)