From: Martin Mares Date: Fri, 16 Apr 2004 15:32:56 +0000 (+0000) Subject: When logging to a file, redirect fd1 to the log file as well. X-Git-Tag: holmes-import~1076 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5b7e7a9679734f87b7eb0c3bebc8941db6ab9a8b;p=libucw.git When logging to a file, redirect fd1 to the log file as well. --- 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); } }