Use correctly FIONBIO values.

This commit is contained in:
Giuseppe Scrivano 2011-04-17 13:07:01 +02:00
parent 1ad97cc7ca
commit 8d764f3ac6
3 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2011-04-17 Giuseppe Scrivano <gscrivano@gnu.org>
* wget.h [HAVE_LIBSSL32]: Define HAVE_SSL.
* gnutls.c (wgnutls_peek): Use correctly FIONBIO codes under Mingw32.
Reported by: Ray Satiro <raysatiro@yahoo.com>
2011-04-13 Giuseppe Scrivano <gscrivano@gnu.org>
* openssl.c (openssl_poll): Check if the specified timeout is zero after

View File

@ -197,8 +197,8 @@ wgnutls_peek (int fd, char *buf, int bufsize, void *arg)
return ret;
#else
/* XXX: Assume it was blocking before. */
const int zero = 0;
ret = ioctl (fd, FIONBIO, &zero);
const int one = 1;
ret = ioctl (fd, FIONBIO, &one);
if (ret < 0)
return ret;
#endif
@ -224,8 +224,8 @@ wgnutls_peek (int fd, char *buf, int bufsize, void *arg)
if (ret < 0)
return ret;
#else
const int one = 1;
ret = ioctl (fd, FIONBIO, &one);
const int zero = 0;
ret = ioctl (fd, FIONBIO, &zero);
if (ret < 0)
return ret;
#endif

View File

@ -52,7 +52,7 @@ as that of the covered work. */
#endif
/* Is OpenSSL or GNUTLS available? */
#if defined HAVE_LIBSSL || defined HAVE_LIBGNUTLS
#if defined HAVE_LIBSSL || defined HAVE_LIBSSL32 || defined HAVE_LIBGNUTLS
# define HAVE_SSL
#endif