From: Martin Mares Date: Wed, 20 Jun 2007 08:04:08 +0000 (+0200) Subject: Moved detaching of stdout from log_file() to the daemon-helper. X-Git-Tag: holmes-import~506^2~74 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0e6bf5a954c657f5f218dc72271dfd110d02b6b4;p=libucw.git Moved detaching of stdout from log_file() to the daemon-helper. --- diff --git a/lib/log-file.c b/lib/log-file.c index 1ef69a14..f880dc1d 100644 --- a/lib/log-file.c +++ b/lib/log-file.c @@ -43,11 +43,8 @@ do_log_switch(struct tm *tm) fd = sh_open(name, O_WRONLY | O_CREAT | O_APPEND, 0666); if (fd < 0) die("Unable to open log file %s: %m", name); - close(2); - dup(fd); + dup2(fd, 2); close(fd); - close(1); - dup(2); switched = 1; } log_switch_nest--;