From 0e6bf5a954c657f5f218dc72271dfd110d02b6b4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 20 Jun 2007 10:04:08 +0200 Subject: [PATCH] Moved detaching of stdout from log_file() to the daemon-helper. --- lib/log-file.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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--; -- 2.39.2