#include <winsock2.h>
#include <ws2tcpip.h>
#else /* Posix */
+#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
+#include <netinet/ip.h>
+#include <netinet/tcp.h>
#include <sys/types.h>
#include <sys/socket.h>
#endif
return -1;
#else /* Posix */
socket_t sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (socket < 0)
+ if (sock < 0)
return -1;
#endif
VERBOSE (ERROR, fprintf (stderr, "error: %d\n", WSAGetLastError ()));
}
#else /* Posix */
- if (socket < 0) {
+ if (rc < 0) {
VERBOSE (ERROR, fprintf (stderr, "error: %d\n", errno));
close (sock);
#endif