diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils_cmd.c | 10 | ||||
-rw-r--r-- | lib/utils_cmd.h | 9 |
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c index 34fb3909..883f1ec1 100644 --- a/lib/utils_cmd.c +++ b/lib/utils_cmd.c | |||
@@ -42,6 +42,16 @@ | |||
42 | #include "common.h" | 42 | #include "common.h" |
43 | #include "utils.h" | 43 | #include "utils.h" |
44 | #include "utils_cmd.h" | 44 | #include "utils_cmd.h" |
45 | /* This variable must be global, since there's no way the caller | ||
46 | * can forcibly slay a dead or ungainly running program otherwise. | ||
47 | * Multithreading apps and plugins can initialize it (via CMD_INIT) | ||
48 | * in an async safe manner PRIOR to calling cmd_run() or cmd_run_array() | ||
49 | * for the first time. | ||
50 | * | ||
51 | * The check for initialized values is atomic and can | ||
52 | * occur in any number of threads simultaneously. */ | ||
53 | static pid_t *_cmd_pids = NULL; | ||
54 | |||
45 | #include "utils_base.h" | 55 | #include "utils_base.h" |
46 | #include <fcntl.h> | 56 | #include <fcntl.h> |
47 | 57 | ||
diff --git a/lib/utils_cmd.h b/lib/utils_cmd.h index 6f3aeb81..1fc2968c 100644 --- a/lib/utils_cmd.h +++ b/lib/utils_cmd.h | |||
@@ -32,15 +32,6 @@ void cmd_init (void); | |||
32 | #define CMD_NO_ARRAYS 0x01 /* don't populate arrays at all */ | 32 | #define CMD_NO_ARRAYS 0x01 /* don't populate arrays at all */ |
33 | #define CMD_NO_ASSOC 0x02 /* output.line won't point to buf */ | 33 | #define CMD_NO_ASSOC 0x02 /* output.line won't point to buf */ |
34 | 34 | ||
35 | /* This variable must be global, since there's no way the caller | ||
36 | * can forcibly slay a dead or ungainly running program otherwise. | ||
37 | * Multithreading apps and plugins can initialize it (via CMD_INIT) | ||
38 | * in an async safe manner PRIOR to calling cmd_run() or cmd_run_array() | ||
39 | * for the first time. | ||
40 | * | ||
41 | * The check for initialized values is atomic and can | ||
42 | * occur in any number of threads simultaneously. */ | ||
43 | static pid_t *_cmd_pids = NULL; | ||
44 | 35 | ||
45 | RETSIGTYPE timeout_alarm_handler (int); | 36 | RETSIGTYPE timeout_alarm_handler (int); |
46 | 37 | ||