Commit 2312f31b by Dwight Engen Committed by Stéphane Graber

Fix fd leak in lxc log

lxc_log_init will leak an fd when it is called by a long running program that may call lxc_container_new multiple times. Fix by only opening the log if it is not already open. Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 181a9be7
......@@ -153,6 +153,9 @@ extern int lxc_log_init(const char *file, const char *priority,
{
int lxc_priority = LXC_LOG_PRIORITY_ERROR;
if (lxc_log_fd != -1)
return 0;
if (priority) {
lxc_priority = lxc_log_priority_to_int(priority);
......
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