aboutsummaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--error.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/error.c b/error.c
index ce61f6c..ec8f9df 100644
--- a/error.c
+++ b/error.c
@@ -521,6 +521,10 @@ redirect_stdout_stderr (const char *file, bool append)
if (msgfp == NULL)
msg (M_ERR, "Error: --log redirect failed due to _fdopen");
+ /* redirect C-library stdout/stderr to log file */
+ if (_dup2 (log_fd, 1) == -1 || _dup2 (log_fd, 2) == -1)
+ msg (M_WARN, "Error: --log redirect of stdout/stderr failed");
+
std_redir = true;
}
#elif defined(HAVE_DUP2)