mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Explicitly use sigemptyset to clear a sigset_t. Explicit
initialization of sa_flags added so that the 'struct sigaction' can be declared local in both functions that use the global (static) declaration. Remove the global declaration.
This commit is contained in:
parent
06ceca4d89
commit
2dc9a8a9f6
@ -509,15 +509,16 @@ ftp_timeout(int sig)
|
|||||||
/* Debug("ftp_pkg: ftp_timeout called - operation timed out"); */
|
/* Debug("ftp_pkg: ftp_timeout called - operation timed out"); */
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sigaction new;
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ftp_set_timeout(void)
|
ftp_set_timeout(void)
|
||||||
{
|
{
|
||||||
|
struct sigaction new;
|
||||||
char *cp;
|
char *cp;
|
||||||
int ival;
|
int ival;
|
||||||
|
|
||||||
FtpTimedOut = FALSE;
|
FtpTimedOut = FALSE;
|
||||||
|
sigemptyset(&new.sa_mask);
|
||||||
|
new.sa_flags = 0;
|
||||||
new.sa_handler = ftp_timeout;
|
new.sa_handler = ftp_timeout;
|
||||||
sigaction(SIGALRM, &new, NULL);
|
sigaction(SIGALRM, &new, NULL);
|
||||||
cp = getenv("FTP_TIMEOUT");
|
cp = getenv("FTP_TIMEOUT");
|
||||||
@ -529,7 +530,11 @@ ftp_set_timeout(void)
|
|||||||
static void
|
static void
|
||||||
ftp_clear_timeout(void)
|
ftp_clear_timeout(void)
|
||||||
{
|
{
|
||||||
|
struct sigaction new;
|
||||||
|
|
||||||
alarm(0);
|
alarm(0);
|
||||||
|
sigemptyset(&new.sa_mask);
|
||||||
|
new.sa_flags = 0;
|
||||||
new.sa_handler = SIG_DFL;
|
new.sa_handler = SIG_DFL;
|
||||||
sigaction(SIGALRM, &new, NULL);
|
sigaction(SIGALRM, &new, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user