plugin_services: compile the systemd collector only on POSIX, silence slice warnings
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-12 08:37:05
Commitb5557676
Parents88158f4d
Changed files
src/plugin_services.c+6−1■■■■■
1 file+6−1
Diff
src/plugin_services.c+6−1■■■■■
index f006912..98f0f33 100644
--- a/src/plugin_services.c
+++ b/src/plugin_services.c
@@ -763,6 +763,7 @@ static int collect_proc_daemons(void)
763763 }
764764 #endif /* !_WIN32 */
765765
766+#if !defined(_WIN32)
766767 static void collect_systemd(void)
767768 {
768769 const char *mock = getenv("SERVICES_MOCK_SYSTEMCTL");
@@ -818,6 +819,8 @@ static void collect_systemd(void)
818819 }
819820 }
820821
822+#endif /* !_WIN32 */
823+
821824 /* ------------------------------------------------------------------ */
822825 /* Collection: launchd (macOS) */
823826 /* ------------------------------------------------------------------ */
@@ -1054,8 +1057,10 @@ static const char *init_name(void)
10541057
10551058 static void collect_all(void)
10561059 {
1057- const char *force = getenv("SERVICES_FORCE_INIT");
10581060 const char *allow = getenv("SERVICES_ALLOW_CONTROL");
1061+#if !defined(_WIN32)
1062+ const char *force = getenv("SERVICES_FORCE_INIT");
1063+#endif
10591064
10601065 g_control = (allow && *allow && strcmp(allow, "0") != 0);
10611066 g_count = 0;
10621067
src/plugin_services.c+6−1■■■■■
index f006912..98f0f33 100644index f006912..98f0f33 100644
--- a/src/plugin_services.c--- a/src/plugin_services.c
+++ b/src/plugin_services.c+++ b/src/plugin_services.c
@@ -763,6 +763,7 @@ static int collect_proc_daemons(void)@@ -763,6 +763,7 @@ static int collect_proc_daemons(void)
763 }763 }
764 #endif /* !_WIN32 */764 #endif /* !_WIN32 */
765 765
766+#if !defined(_WIN32)
766 static void collect_systemd(void)767 static void collect_systemd(void)
767 {768 {
768 const char *mock = getenv("SERVICES_MOCK_SYSTEMCTL");769 const char *mock = getenv("SERVICES_MOCK_SYSTEMCTL");
@@ -818,6 +819,8 @@ static void collect_systemd(void)@@ -818,6 +819,8 @@ static void collect_systemd(void)
818 }819 }
819 }820 }
820 821
822+#endif /* !_WIN32 */
823+
821 /* ------------------------------------------------------------------ */824 /* ------------------------------------------------------------------ */
822 /* Collection: launchd (macOS) */825 /* Collection: launchd (macOS) */
823 /* ------------------------------------------------------------------ */826 /* ------------------------------------------------------------------ */
@@ -1054,8 +1057,10 @@ static const char *init_name(void)@@ -1054,8 +1057,10 @@ static const char *init_name(void)
1054 1057
1055 static void collect_all(void)1058 static void collect_all(void)
1056 {1059 {
1057- const char *force = getenv("SERVICES_FORCE_INIT");
1058 const char *allow = getenv("SERVICES_ALLOW_CONTROL");1060 const char *allow = getenv("SERVICES_ALLOW_CONTROL");
1061+#if !defined(_WIN32)
1062+ const char *force = getenv("SERVICES_FORCE_INIT");
1063+#endif
1059 1064
1060 g_control = (allow && *allow && strcmp(allow, "0") != 0);1065 g_control = (allow && *allow && strcmp(allow, "0") != 0);
1061 g_count = 0;1066 g_count = 0;
10621067