{
int in = fileno (stdin), out = fileno (stdout),
nbuffer, wrote;
- struct pollfd readfds[2], writefds[1];
- char buffer[BUFSIZ], *retry;
+ struct pollfd readfds[2];
+ char buffer[BUFSIZ];
struct sigaction act;
- sigset_t orig_mask;
+ sigset_t mask, orig_mask;
int this_option_optind = optind ? optind : 1;
int option_index = 0, c;
memset (&act, 0, sizeof (act));
act.sa_handler = do_tls_negotiate;
sigemptyset (&act.sa_mask);
- sigaddset (&act.sa_mask, SIGALRM);
act.sa_flags = SA_RESTART|SA_RESETHAND;
sigaction (SIGALRM, &act, NULL);
+ sigemptyset (&mask);
+ sigaddset (&mask, SIGALRM);
+
readfds[0].fd = in;
readfds[1].fd = tls_fd;
readfds[0].events = POLLIN;
readfds[1].events = POLLIN;
- writefds[0].events = POLLOUT;
while (1)
{
int ready;
- sigprocmask (SIG_SETMASK, &act.sa_mask, &orig_mask);
+ sigprocmask (SIG_SETMASK, &mask, &orig_mask);
ready = poll (readfds, 2, -1);
sigprocmask (SIG_SETMASK, &orig_mask, NULL);
if (ready == -1 && errno != EINTR)