mirror of
https://github.com/nmap/nmap.git
synced 2026-11-20 08:40:36 +08:00
Ensure vars updated by signal handlers are volatile and atomic. Fixes #2245
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
+1
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user