Commit ba64f87b authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

log: Fix logfd screwup

Broken by 7aa8e4b6 -- log was not moved to higher fd values.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 119cee0d
......@@ -48,8 +48,6 @@ int log_init(const char *output)
* requested.
*/
new_logfd = rlimit.rlim_cur - 1;
if (output) {
new_logfd = open(output, O_CREAT | O_WRONLY);
if (new_logfd < 0) {
......@@ -57,11 +55,12 @@ int log_init(const char *output)
return -1;
}
current_logfd = new_logfd;
} else {
if (reopen_fd_as(new_logfd, current_logfd) < 0)
goto err;
current_logfd = new_logfd;
}
} else
new_logfd = DEFAULT_LOGFD;
current_logfd = rlimit.rlim_cur - 1;
if (reopen_fd_as(current_logfd, new_logfd) < 0)
goto err;
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment