along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_socket.c,v 1.1.2.31 2003/07/24 12:08:15 guus Exp $
+ $Id: net_socket.c,v 1.1.2.32 2003/07/28 22:06:09 guus Exp $
*/
#include "system.h"
#include "utils.h"
#include "xalloc.h"
+#ifdef WSAEINPROGRESS
+#define EINPROGRESS WSAEINPROGRESS
+#endif
+
int addressfamily = AF_UNSPEC;
int maxtimeout = 900;
int seconds_till_retry = 5;
char *addrstr;
int option;
char *iface;
+#ifdef SO_BINDTODEVICE
struct ifreq ifr;
+#endif
cp();
return -1;
}
+#ifdef O_NONBLOCK
flags = fcntl(nfd, F_GETFL);
if(fcntl(nfd, F_SETFL, flags | O_NONBLOCK) < 0) {
strerror(errno));
return -1;
}
+#endif
/* Optimize TCP settings */
return -1;
}
+#ifdef O_NONBLOCK
flags = fcntl(nfd, F_GETFL);
if(fcntl(nfd, F_SETFL, flags | O_NONBLOCK) < 0) {
close(nfd);
strerror(errno));
return -1;
}
+#endif
option = 1;
setsockopt(nfd, SOL_SOCKET, SO_REUSEADDR, &option, sizeof(option));
/* Non-blocking */
+#ifdef O_NONBLOCK
flags = fcntl(c->socket, F_GETFL);
if(fcntl(c->socket, F_SETFL, flags | O_NONBLOCK) < 0) {
logger(LOG_ERR, _("fcntl for %s: %s"), c->hostname, strerror(errno));
}
+#endif
/* Connect */