mirror of
https://github.com/nmap/nmap.git
synced 2026-10-21 11:22:05 +00:00
Ensure vars updated by signal handlers are volatile and atomic. Fixes #2245
This commit is contained in:
parent
3860d258c4
commit
32d1b967fc
4 changed files with 5 additions and 3 deletions
|
|
@ -146,7 +146,7 @@ static char *chat_filter(char *buf, size_t size, int fd, int *nwritten);
|
|||
(synchronously) only in the main program. get_conn_count loops while conn_dec
|
||||
is being modified. */
|
||||
static unsigned int conn_inc = 0;
|
||||
static volatile unsigned int conn_dec = 0;
|
||||
static volatile sig_atomic_t conn_dec = 0;
|
||||
static volatile sig_atomic_t conn_dec_changed;
|
||||
|
||||
static void decrease_conn_count(void)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
|
||||
char **cmdline_split(const char *cmdexec);
|
||||
|
||||
static int child_alive = 0;
|
||||
volatile sig_atomic_t child_alive = 0;
|
||||
|
||||
static void sigchld_watcher(int signum)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,8 +72,10 @@
|
|||
/* SIG_CHLD handler */
|
||||
static void proxyreaper(int signo)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
while (waitpid(-1, NULL, WNOHANG) > 0)
|
||||
;
|
||||
errno = saved_errno;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ extern int tcsetattr(int fd, int actions, struct termios *termios_p);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
static int tty_fd = 0;
|
||||
static volatile sig_atomic_t tty_fd = 0;
|
||||
static struct termios saved_ti;
|
||||
|
||||
static int tty_getchar()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue