Fixed client error, added dead snack catch, fixing server io redirection
[tpg/opendispense2.git] / src / server / server.c
index 483806a..9ee4ec7 100644 (file)
@@ -164,9 +164,15 @@ void Server_Start(void)
                }
                // In child
                // - Sort out stdin/stdout
+               #if 0
                dup2( open("/dev/null", O_RDONLY, 0644), STDIN_FILENO );
                dup2( open(gsServer_LogFile, O_CREAT|O_APPEND, 0644), STDOUT_FILENO );
                dup2( open(gsServer_ErrorLog, O_CREAT|O_APPEND, 0644), STDERR_FILENO );
+               #else
+               freopen("/dev/null", "r", stdin);
+               freopen(gsServer_LogFile, "a", stdout);
+               freopen(gsServer_ErrorLog, "a", stderr);
+               #endif
        }
 
        // Start the helper thread

UCC git Repository :: git.ucc.asn.au