|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
|
|
|
|
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
|
|
|
|
* Copyright (C) 2004-2010 by Daniel Stenberg |
|
|
|
|
* Copyright (C) 2004-2011 by Daniel Stenberg |
|
|
|
|
* |
|
|
|
|
* Permission to use, copy, modify, and distribute this |
|
|
|
|
* software and its documentation for any purpose and without |
|
|
|
@ -837,30 +837,29 @@ static int setsocknonblock(ares_socket_t sockfd, /* operate on this */ |
|
|
|
|
#elif defined(HAVE_IOCTL_FIONBIO) |
|
|
|
|
|
|
|
|
|
/* older unix versions */ |
|
|
|
|
int flags; |
|
|
|
|
flags = nonblock; |
|
|
|
|
int flags = nonblock ? 1 : 0; |
|
|
|
|
return ioctl(sockfd, FIONBIO, &flags); |
|
|
|
|
|
|
|
|
|
#elif defined(HAVE_IOCTLSOCKET_FIONBIO) |
|
|
|
|
|
|
|
|
|
#ifdef WATT32 |
|
|
|
|
char flags; |
|
|
|
|
char flags = nonblock ? 1 : 0; |
|
|
|
|
#else |
|
|
|
|
/* Windows */ |
|
|
|
|
unsigned long flags; |
|
|
|
|
unsigned long flags = nonblock ? 1UL : 0UL; |
|
|
|
|
#endif |
|
|
|
|
flags = nonblock; |
|
|
|
|
return ioctlsocket(sockfd, FIONBIO, &flags); |
|
|
|
|
|
|
|
|
|
#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO) |
|
|
|
|
|
|
|
|
|
/* Amiga */ |
|
|
|
|
return IoctlSocket(sockfd, FIONBIO, (long)nonblock); |
|
|
|
|
long flags = nonblock ? 1L : 0L; |
|
|
|
|
return IoctlSocket(sockfd, FIONBIO, flags); |
|
|
|
|
|
|
|
|
|
#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK) |
|
|
|
|
|
|
|
|
|
/* BeOS */ |
|
|
|
|
long b = nonblock ? 1 : 0; |
|
|
|
|
long b = nonblock ? 1L : 0L; |
|
|
|
|
return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b)); |
|
|
|
|
|
|
|
|
|
#else |
|
|
|
|