Browse code

- if log_stderr & fork close all FDs except 3 (stderror) - until now it didn't close any of them (BUG!)

Andrei Pelinescu-Onciul authored on 30/09/2002 18:38:37
Showing 1 changed files
... ...
@@ -387,11 +387,10 @@ int daemonize(char*  name)
387 387
 	}
388 388
 	
389 389
 	/* close any open file descriptors */
390
-	if (log_stderr==0)
391
-		for (r=0;r<MAX_FD; r++){
390
+	for (r=0;r<MAX_FD; r++){
392 391
 			if ((r==3) && log_stderr)  continue;
393 392
 			close(r);
394
-		}
393
+	}
395 394
 	return  0;
396 395
 
397 396
 error: