I am trying to write a Linux Daemon that will accept TCP/IP connections on a specific port. During development I did not have the code in that creates a child process and then exits the parent and everything worked fine. I was able to run a test for 24 hours without a problem.

However, after putting the code at the beginning that initiates a child process, then exits the Parent the Accept function started to fail. Below is my accept function.

if((new_sock = accept(sock, (struct sockaddr*) &client_name, &size)) < 0){
syslog(LOG_MAKEPRI(LOG_LOCAL1, LOG_ERR), "Error accepting connection");
}

When I run it and the connecting device attempts to connect, the Syslog starts to fill up with the above message if it is running as a child process.

If this is not the proper forum for this question, please forgive me and point me to the correct forum.