From b883bedfecc419c6d1e3e57a2d906370fb38a1e1 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Mon, 19 Sep 2011 03:08:56 +0000
Subject: [PATCH] Fixed use of select() in nonblocking_connect().

---
 src/xpdev/sockwrap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xpdev/sockwrap.c b/src/xpdev/sockwrap.c
index 6197e77440..b31acbcd42 100644
--- a/src/xpdev/sockwrap.c
+++ b/src/xpdev/sockwrap.c
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This library is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU Lesser General Public License		*
@@ -378,7 +378,7 @@ int nonblocking_connect(SOCKET sock, struct sockaddr* addr, size_t size, unsigne
 		tv.tv_usec = 0;
 		FD_ZERO(&socket_set);
 		FD_SET(sock,&socket_set);
-		if(select(sock,NULL,&socket_set,NULL,&tv)==1)
+		if(select(sock+1,NULL,&socket_set,NULL,&tv)==1)
 			getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*)&result, &optlen);
 	}
 	return result;
-- 
GitLab