diff options
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -5,7 +5,7 @@ * packet encryption, packet authentication, and * packet compression. * - * Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net> + * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -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) |