]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Define g_autoptr callback for FILE
authorJiri Denemark <jdenemar@redhat.com>
Tue, 31 Mar 2020 23:01:27 +0000 (01:01 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 25 May 2020 14:09:41 +0000 (16:09 +0200)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virfile.h

index 0a520a7522dc446837ab76f6ceaeeef973b711e9..7a92364a5c9fefeee3c4e0bc41eb465f89e29131 100644 (file)
@@ -89,6 +89,7 @@ static inline void virForceCloseHelper(int *fd)
  */
 #define VIR_AUTOCLOSE __attribute__((cleanup(virForceCloseHelper))) int
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(FILE, fclose);
 
 /* Opaque type for managing a wrapper around a fd.  */
 struct _virFileWrapperFd;