Re: [libvirt] [PATCH v2] Make sure that filedescriptors are only closed once

2010-10-15 Thread Laine Stump
On 10/15/2010 07:17 AM, Stefan Berger wrote: Well, what about a VIR_CLOSE() to prevent such mistakes in the future. That sounds like a good idea to me. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v2] Make sure that filedescriptors are only closed once

2010-10-15 Thread Stefan Berger
On 10/15/2010 07:16 AM, Daniel P. Berrange wrote: On Thu, Oct 14, 2010 at 09:31:59PM -0400, Stefan Berger wrote: V2: also the path where close() failed needs to be corrected; -> time for a VIR_CLOSE() ? Setting fd=-1 in these places makes sure that the fd is not closed twice later on in

Re: [libvirt] [PATCH v2] Make sure that filedescriptors are only closed once

2010-10-15 Thread Daniel P. Berrange
On Thu, Oct 14, 2010 at 09:31:59PM -0400, Stefan Berger wrote: > V2: > also the path where close() failed needs to be corrected; > > -> time for a VIR_CLOSE() ? > > Setting fd=-1 in these places makes sure that the fd is not closed twice > later on in 'clean:'. This is of course a recipe for

[libvirt] [PATCH v2] Make sure that filedescriptors are only closed once

2010-10-14 Thread Stefan Berger
V2: also the path where close() failed needs to be corrected; -> time for a VIR_CLOSE() ? Setting fd=-1 in these places makes sure that the fd is not closed twice later on in 'clean:'. This is of course a recipe for disaster in a multi-threaded system where the filedescriptor can belong to