fixed small compilation errors (debug mode)
[NeonServV5.git] / src / main.c
index c88c02cbfcefc866a8b82526d2e3a65809cc1414..72d3fb7e1952ec51a572fa3dd85b451811a41e22 100644 (file)
@@ -131,10 +131,9 @@ static void main_daemonize() {
         fprintf(pidfile, "%i\n", (int)getpid());
         fclose(pidfile);
     }
-    FILE *retn;
-    fclose(stdin); retn = fopen("/dev/null", "r");
-    fclose(stdout); retn = fopen("/dev/null", "w");
-    fclose(stderr); retn = fopen("/dev/null", "w");
+    fclose(stdin); fopen("/dev/null", "r");
+    fclose(stdout); fopen("/dev/null", "w");
+    fclose(stderr); fopen("/dev/null", "w");
     #endif
 }
 
@@ -305,6 +304,11 @@ int main(int argc, char *argv[]) {
     initMemoryDebug();
     #endif
     
+    //initialize mutex debugger BEFORE using any mutexes
+    #ifdef ENABLE_MUTEX_DEBUG
+    initMutexDebug();
+    #endif
+    
     //deny root startup
     #ifndef WIN32
     if(geteuid() == 0 || getuid() == 0) {