File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments