| index 98f0f33..6902b96 100644 | | index 98f0f33..6902b96 100644 |
| --- a/src/plugin_services.c | | --- a/src/plugin_services.c |
| +++ b/src/plugin_services.c | | +++ b/src/plugin_services.c |
| @@ -314,6 +314,7 @@ static void require_node_auth(void) | | @@ -314,6 +314,7 @@ static void require_node_auth(void) |
| 314 | /* Command capture and argv execution */ | 314 | /* Command capture and argv execution */ |
| 315 | /* ------------------------------------------------------------------ */ | 315 | /* ------------------------------------------------------------------ */ |
| 316 | | 316 | |
| | 317 | +#if !defined(_WIN32) |
| 317 | /* Every command string passed here is a CONSTANT defined in this file, or is | 318 | /* Every command string passed here is a CONSTANT defined in this file, or is |
| 318 | * built from a value that already passed valid_unit(). Nothing user-supplied | 319 | * built from a value that already passed valid_unit(). Nothing user-supplied |
| 319 | * reaches this function unvalidated. */ | 320 | * reaches this function unvalidated. */ |
| @@ -334,7 +335,6 @@ static int capture(const char *cmd, char *out, size_t outsz) | | @@ -334,7 +335,6 @@ static int capture(const char *cmd, char *out, size_t outsz) |
| 334 | return (int)n; | 335 | return (int)n; |
| 335 | } | 336 | } |
| 336 | | 337 | |
| 337 | -#if !defined(_WIN32) | | |
| 338 | /* Returns the child's exit status, or -1 when it could not be started. The | 338 | /* Returns the child's exit status, or -1 when it could not be started. The |
| 339 | * unit is a separate argv element, so no shell ever sees it. */ | 339 | * unit is a separate argv element, so no shell ever sees it. */ |
| 340 | static int run_argv(char *const argv[]) | 340 | static int run_argv(char *const argv[]) |
| @@ -357,6 +357,8 @@ static int run_argv(char *const argv[]) | | @@ -357,6 +357,8 @@ static int run_argv(char *const argv[]) |
| 357 | /* ------------------------------------------------------------------ */ | 357 | /* ------------------------------------------------------------------ */ |
| 358 | /* Minimal JSON field extraction (for systemctl --output=json output) */ | 358 | /* Minimal JSON field extraction (for systemctl --output=json output) */ |
| 359 | /* ------------------------------------------------------------------ */ | 359 | /* ------------------------------------------------------------------ */ |
| | 360 | +/* The JSON readers and the systemd/launchd parsers are POSIX-only: the |
| | 361 | + * Windows slice talks to the SCM directly and never parses text. */ |
| 360 | | 362 | |
| 361 | static int json_read_string_at(const char **pp, char *out, size_t outsz) | 363 | static int json_read_string_at(const char **pp, char *out, size_t outsz) |
| 362 | { | 364 | { |
| @@ -476,6 +478,7 @@ static svc_t *svc_find(const char *name) | | @@ -476,6 +478,7 @@ static svc_t *svc_find(const char *name) |
| 476 | return NULL; | 478 | return NULL; |
| 477 | } | 479 | } |
| 478 | | 480 | |
| | 481 | +#if !defined(_WIN32) |
| 479 | static char *read_file_all(const char *path, size_t *len) | 482 | static char *read_file_all(const char *path, size_t *len) |
| 480 | { | 483 | { |
| 481 | FILE *f; | 484 | FILE *f; |
| @@ -670,7 +673,6 @@ static void apply_show(const char *text) | | @@ -670,7 +673,6 @@ static void apply_show(const char *text) |
| 670 | } | 673 | } |
| 671 | | 674 | |
| 672 | /* Containers with no init system: list /proc/<pid> long-running daemons. */ | 675 | /* Containers with no init system: list /proc/<pid> long-running daemons. */ |
| 673 | -#if !defined(_WIN32) | | |
| 674 | static int collect_proc_daemons(void) | 676 | static int collect_proc_daemons(void) |
| 675 | { | 677 | { |
| 676 | const char *root = getenv("SERVICES_MOCK_PROC_DIR"); | 678 | const char *root = getenv("SERVICES_MOCK_PROC_DIR"); |
| @@ -761,9 +763,7 @@ static int collect_proc_daemons(void) | | @@ -761,9 +763,7 @@ static int collect_proc_daemons(void) |
| 761 | closedir(d); | 763 | closedir(d); |
| 762 | return g_count; | 764 | return g_count; |
| 763 | } | 765 | } |
| 764 | -#endif /* !_WIN32 */ | | |
| 765 | | 766 | |
| 766 | -#if !defined(_WIN32) | | |
| 767 | static void collect_systemd(void) | 767 | static void collect_systemd(void) |
| 768 | { | 768 | { |
| 769 | const char *mock = getenv("SERVICES_MOCK_SYSTEMCTL"); | 769 | const char *mock = getenv("SERVICES_MOCK_SYSTEMCTL"); |
| 770 | | 770 | |