-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.126 2014/06/02 06:22:20 fabiankeil Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.130 2014/10/18 11:28:05 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
"Server socket number too high to use select(): %d >= %d",
fd, FD_SETSIZE);
close_socket(fd);
+ freeaddrinfo(result);
return JB_INVALID_SOCKET;
}
#endif
fd = socket(AF_INET, SOCK_STREAM, 0);
#endif /* def HAVE_RFC2553 */
-#ifdef FEATURE_EXTERNAL_FILTERS
- mark_socket_for_close_on_execute(fd);
-#endif
-
#ifdef _WIN32
if (fd == JB_INVALID_SOCKET)
#else
#endif
}
+#ifdef FEATURE_EXTERNAL_FILTERS
+ mark_socket_for_close_on_execute(fd);
+#endif
+
#ifndef _WIN32
/*
* This is not needed for Win32 - in fact, it stops
{
if (errno != EINTR)
{
+ close_socket(fd);
return(-1);
}
}
setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &af_options, sizeof(af_options));
#endif
afd = accept (fd, (struct sockaddr *) &client, &c_length);
- } while (afd < 1 && errno == EINTR);
+ } while (afd < 0 && errno == EINTR);
if (afd < 0)
{
return 0;