From: Laurent Mazet Date: Sat, 6 May 2023 09:54:07 +0000 (+0200) Subject: adapt to linux X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=47deaa73f653f03e52ef2390f4cc8bfa8d92291e;p=webserver.git adapt to linux --- diff --git a/webserver.c b/webserver.c index 5b43848..530f1aa 100644 --- a/webserver.c +++ b/webserver.c @@ -9,8 +9,11 @@ #include #include #else /* Posix */ +#include #include #include +#include +#include #include #include #endif @@ -66,7 +69,7 @@ socket_t open_listening_socket (int port) return -1; #else /* Posix */ socket_t sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); - if (socket < 0) + if (sock < 0) return -1; #endif @@ -88,7 +91,7 @@ socket_t open_listening_socket (int port) 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