Browse code

- fixed a typo (r instead of w in freopen stderr)

Andrei Pelinescu-Onciul authored on 09/12/2002 17:26:29
Showing 1 changed files
... ...
@@ -404,7 +404,7 @@ int daemonize(char*  name)
404 404
 		/* continue, leave it open */
405 405
 	};
406 406
 	/* close stderr only if log_stderr=0 */
407
-	if ((!log_stderr) &&(freopen("/dev/null", "r", stderr)==0)){
407
+	if ((!log_stderr) &&(freopen("/dev/null", "w", stderr)==0)){
408 408
 		LOG(L_ERR, "unable to replace stderr with /dev/null: %s\n",
409 409
 				strerror(errno));
410 410
 		/* continue, leave it open */
... ...
@@ -560,7 +560,14 @@ int main_loop()
560 560
 		*/
561 561
 
562 562
 		/* we need another process to act as the timer*/
563
-		if (timer_list){
563
+#ifndef USE_TCP
564
+		/* if we are using tcp we always need a timer process,
565
+		 * we cannot count on select timeout to measure time
566
+		 * (it works only on linux)
567
+		 */
568
+		if (timer_list)
569
+#endif
570
+		{
564 571
 				process_no++;
565 572
 				if ((pid=fork())<0){
566 573
 					LOG(L_CRIT,  "ERROR: main_loop: Cannot fork\n");