Skip to content

Commit 1394a0a

Browse files
committed
InitSystem (macOS): fix compiling
1 parent e8ebae7 commit 1394a0a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/detection/initsystem/initsystem_linux.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "util/linux/elf.h"
44
#include <unistd.h>
55

6-
static bool elfExtractStringsCallBack(const char* str, uint32_t len, void* data)
6+
FF_MAYBE_UNUSED static bool elfExtractStringsCallBack(const char* str, uint32_t len, void* data)
77
{
88
if (len > strlen("systemd 0.0 running in ") && memcmp(str, "systemd ", strlen("systemd ")) == 0)
99
{
@@ -46,6 +46,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
4646

4747
if (instance.config.general.detectVersion)
4848
{
49+
#ifdef __linux__
4950
if (ffStrbufEqualS(&result->name, "systemd"))
5051
{
5152
ffElfExtractStrings(result->exe.chars, elfExtractStringsCallBack, &result->version);
@@ -67,7 +68,8 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
6768
}
6869
}
6970
}
70-
else if (ffStrbufEqualS(&result->name, "launchd"))
71+
#elif __APPLE__
72+
if (ffStrbufEqualS(&result->name, "launchd"))
7173
{
7274
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
7375
"/bin/launchctl",
@@ -85,6 +87,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result)
8587
}
8688
}
8789
}
90+
#endif
8891
}
8992

9093
return NULL;

0 commit comments

Comments
 (0)