Call to listen() is now being checked for error.
Now each time a new connection is made it is handled in a new process (using fork()).
The main loop is waing for connections infinitely.
Added ignoring child signal, to avoid creating zombie processes.
Also changed type of pid variable from __pid_t to pid_t