[libvirt] [PATCH] deprecate fclose() and introduce VIR_{FORCE_}FCLOSE()

2010-11-12 Thread Stefan Berger
Similarly to deprecating close(), I am now deprecating fclose() and introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Most of the files are opened in read-only mode, so usage of VIR_FORCE_CLOSE() seemed appropriate. Others that are opened in write mode already had the fclose() 0 check and I

[libvirt] [PATCH] deprecate fclose() and introduce VIR_{FORCE_}FCLOSE()

2010-11-12 Thread Stefan Berger
Similarly to deprecating close(), I am now deprecating fclose() and introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Most of the files are opened in read-only mode, so usage of VIR_FORCE_CLOSE() seemed appropriate. Others that are opened in write mode already had the fclose() 0 check and I

Re: [libvirt] [PATCH] deprecate fclose() and introduce VIR_{FORCE_}FCLOSE()

2010-11-12 Thread Eric Blake
On 11/12/2010 09:38 AM, Stefan Berger wrote: Similarly to deprecating close(), I am now deprecating fclose() and introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Most of the files are opened in read-only mode, so usage of VIR_FORCE_CLOSE() seemed appropriate. Others that are opened in write

Re: [libvirt] [PATCH] deprecate fclose() and introduce VIR_{FORCE_}FCLOSE()

2010-11-12 Thread Stefan Berger
On 11/12/2010 11:58 AM, Eric Blake wrote: On 11/12/2010 09:38 AM, Stefan Berger wrote: Similarly to deprecating close(), I am now deprecating fclose() and introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Most of the files are opened in read-only mode, so usage of VIR_FORCE_CLOSE() seemed

Re: [libvirt] [PATCH] deprecate fclose() and introduce VIR_{FORCE_}FCLOSE()

2010-11-12 Thread Eric Blake
On 11/12/2010 10:47 AM, Stefan Berger wrote: -if (list) -fclose(list); -else -VIR_FORCE_CLOSE(fd); +VIR_FORCE_FCLOSE(list); +VIR_FORCE_CLOSE(fd); You just introduced a double close. list was created via fdopen(fd), :-( In that case, what about wrapping