From 5b7e7a9679734f87b7eb0c3bebc8941db6ab9a8b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 16 Apr 2004 15:32:56 +0000 Subject: [PATCH] When logging to a file, redirect fd1 to the log file as well. --- lib/log.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/log.c b/lib/log.c index 381f7257..c2f3e6ff 100644 --- a/lib/log.c +++ b/lib/log.c @@ -54,6 +54,8 @@ log_switch(struct tm *tm) close(2); dup(fd); close(fd); + close(1); + dup(2); } log_switching--; } @@ -188,5 +190,7 @@ log_file(byte *name) log_name = xmalloc(log_name_size); log_name[0] = 0; log_switch(tm); + close(0); + open("/dev/null", O_RDWR, 0); } } -- 2.39.2