Place _cmd_pids in object not header to avoid unsused variables

This commit is contained in:
RincewindsHat 2023-03-05 15:47:49 +01:00 committed by Lorenz Kästle
parent 7f460dd60a
commit a3029c5a2e
2 changed files with 10 additions and 9 deletions

View file

@ -42,6 +42,16 @@
#include "common.h"
#include "utils.h"
#include "utils_cmd.h"
/* This variable must be global, since there's no way the caller
* can forcibly slay a dead or ungainly running program otherwise.
* Multithreading apps and plugins can initialize it (via CMD_INIT)
* in an async safe manner PRIOR to calling cmd_run() or cmd_run_array()
* for the first time.
*
* The check for initialized values is atomic and can
* occur in any number of threads simultaneously. */
static pid_t *_cmd_pids = NULL;
#include "utils_base.h"
#include <fcntl.h>

View file

@ -32,15 +32,6 @@ void cmd_init (void);
#define CMD_NO_ARRAYS 0x01 /* don't populate arrays at all */
#define CMD_NO_ASSOC 0x02 /* output.line won't point to buf */
/* This variable must be global, since there's no way the caller
* can forcibly slay a dead or ungainly running program otherwise.
* Multithreading apps and plugins can initialize it (via CMD_INIT)
* in an async safe manner PRIOR to calling cmd_run() or cmd_run_array()
* for the first time.
*
* The check for initialized values is atomic and can
* occur in any number of threads simultaneously. */
static pid_t *_cmd_pids = NULL;
RETSIGTYPE timeout_alarm_handler (int);