Fixed error in compilation

This commit is contained in:
TriantaTV 2023-09-26 14:37:47 -05:00
parent c302bed499
commit 44fb3aa66e

View File

@ -43,6 +43,7 @@
#include <netinet/in.h> //
#include <sys/socket.h> //
#include <arpa/inet.h> //
#include <unistd.h>
#endif
/* ------------------------------------------------------------------------ */
@ -93,7 +94,7 @@ int main(void)
unsigned int client_s; // Client socket descriptor
struct sockaddr_in client_addr; // Client Internet address
struct in_addr client_ip_addr; // Client IP address
int addr_len; // Internet address length
socklen_t addr_len; // Internet address length
/* FOR UNIX/LINUX ------------------------------------------------------ */
#ifdef UNIX
@ -118,7 +119,7 @@ int main(void)
// Main loop to listen, accept, and then spin-off a thread to handle the GET
while (1)
{
// Listen for connections and then accept
// Listen for connections and then accept
listen(server_s, 100);
addr_len = sizeof(client_addr);
@ -135,7 +136,7 @@ int main(void)
nChild_proc_id = fork();
// Separate the parent and child process here ...
if (nChild_proc_id == -1) // if I am a new child, go to the child module.
if (nChild_proc_id == 0) // if I am a new child, go to the child module.
{
child_proc(server_s, client_s);
}