It is read by `sig_pass_to_chld()` and `sig_chld()` from signal context,
and written from the main thread (after fork). Plain int is not
guaranteed to be safe across this boundary.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
/* If there is no privilege separation, seccomp is currently useless */
#ifdef ENABLE_PRIVSEP
-static int monitored = -1;
-static int trapped = 0;
+static volatile sig_atomic_t monitored = -1;
+static volatile sig_atomic_t trapped = 0;
/**
* SIGSYS signal handler
* @param nr the signal number
#endif
#ifdef ENABLE_PRIVSEP
-static int monitored = -1; /* Child */
+static volatile sig_atomic_t monitored = -1; /* Child */
#endif
static char *ctlname = NULL; /* Registered control socket path */