From: ueno Date: Wed, 17 Oct 2001 03:40:32 +0000 (+0000) Subject: * starttls.c (main): Clear fd sets before select(). X-Git-Tag: starttls-0_9~28 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=856856b4f9d0601ee32a019b9681ca42f92efd18;p=elisp%2Fstarttls.git * starttls.c (main): Clear fd sets before select(). --- diff --git a/starttls.c b/starttls.c index 27ef839..f777d9b 100644 --- a/starttls.c +++ b/starttls.c @@ -260,6 +260,7 @@ main (argc, argv) while (1) { + FD_ZERO (&readfds); FD_SET (tls_fd, &readfds); FD_SET (in, &readfds); if (select (tls_fd+1, &readfds, NULL, NULL, NULL) == -1 @@ -276,6 +277,7 @@ main (argc, argv) goto finish; for (retry = buffer; nbuffer > 0; nbuffer -= wrote, retry += wrote) { + FD_ZERO (&writefds); FD_SET (tls_fd, &writefds); if (select (tls_fd+1, NULL, &writefds, NULL, NULL) == -1) { @@ -299,6 +301,7 @@ main (argc, argv) goto finish; for (retry = buffer; nbuffer > 0; nbuffer -= wrote, retry += wrote) { + FD_ZERO (&writefds); FD_SET (out, &writefds); if (select (out+1, NULL, &writefds, NULL, NULL) == -1) {