summaryrefslogtreecommitdiffstats
path: root/lib/libftpio
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>1999-09-28 13:33:13 +0000
committermarcel <marcel@FreeBSD.org>1999-09-28 13:33:13 +0000
commitffae785399df356992776b7d84880ae94ab5e0f6 (patch)
treec121ccab9a0947f45268615d30aea6d567ed589e /lib/libftpio
parent971179f4cd40b802ce6d37b2c3f09cdee97fa8ac (diff)
downloadFreeBSD-src-ffae785399df356992776b7d84880ae94ab5e0f6.zip
FreeBSD-src-ffae785399df356992776b7d84880ae94ab5e0f6.tar.gz
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.
Diffstat (limited to 'lib/libftpio')
-rw-r--r--lib/libftpio/ftpio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c
index 45f7012..35f2b15 100644
--- a/lib/libftpio/ftpio.c
+++ b/lib/libftpio/ftpio.c
@@ -509,15 +509,16 @@ ftp_timeout(int sig)
/* Debug("ftp_pkg: ftp_timeout called - operation timed out"); */
}
-static struct sigaction new;
-
static void
ftp_set_timeout(void)
{
+ struct sigaction new;
char *cp;
int ival;
FtpTimedOut = FALSE;
+ sigemptyset(&new.sa_mask);
+ new.sa_flags = 0;
new.sa_handler = ftp_timeout;
sigaction(SIGALRM, &new, NULL);
cp = getenv("FTP_TIMEOUT");
@@ -529,7 +530,11 @@ ftp_set_timeout(void)
static void
ftp_clear_timeout(void)
{
+ struct sigaction new;
+
alarm(0);
+ sigemptyset(&new.sa_mask);
+ new.sa_flags = 0;
new.sa_handler = SIG_DFL;
sigaction(SIGALRM, &new, NULL);
}
OpenPOWER on IntegriCloud