--- netutils.c	2008-12-08 19:30:27.000000000 +0200
+++ /tmp/netutils.c	2009-06-13 14:15:00.000000000 +0200
@@ -61,7 +61,7 @@
 			freeaddrinfo(r);
 			return ERROR;
 			}
-		if(sd>0)
+		if(*sd>0)
 			break;
 
 		close(*sd);
