[lxc-devel] [PATCH] Fix fd leak in lxc log
Stéphane Graber
stgraber at ubuntu.com
Mon Nov 26 17:55:03 UTC 2012
On 11/26/2012 12:38 PM, Serge Hallyn wrote:
> Quoting Dwight Engen (dwight.engen at oracle.com):
>> 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: Dwight Engen <dwight.engen at oracle.com>
>
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
Thanks, applied to staging.
>> ---
>> src/lxc/log.c | 3 +++
>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/lxc/log.c b/src/lxc/log.c
>> index 7f3b6b2..02ee21c 100644
>> --- a/src/lxc/log.c
>> +++ b/src/lxc/log.c
>> @@ -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);
>>
>> --
>> 1.7.1
>>
>>
>> ------------------------------------------------------------------------------
>> Monitor your physical, virtual and cloud infrastructure from a single
>> web console. Get in-depth insight into apps, servers, databases, vmware,
>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>> Pricing starts from $795 for 25 servers or applications!
>> http://p.sf.net/sfu/zoho_dev2dev_nov
>> _______________________________________________
>> Lxc-devel mailing list
>> Lxc-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/lxc-devel
>
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
>
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20121126/7681619d/attachment.pgp>
More information about the lxc-devel
mailing list