From: Laine Stump Date: Mon, 19 Oct 2020 13:15:50 +0000 (-0400) Subject: util: declare g_autoptr cleanup function to auto-close DIR* X-Git-Tag: v6.10.0-rc1~392 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a61472aad8b57badbcf569b9dc0805fa41d57ace;p=thirdparty%2Flibvirt.git util: declare g_autoptr cleanup function to auto-close DIR* Signed-off-by: Laine Stump Reviewed-by: Daniel Henrique Barboza --- diff --git a/src/util/virfile.h b/src/util/virfile.h index 6fde4f88ca..6973fbd54a 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -271,6 +271,7 @@ int virDirRead(DIR *dirp, struct dirent **ent, const char *dirname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; void virDirClose(DIR *dirp) ATTRIBUTE_NONNULL(1); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(DIR, virDirClose); #define VIR_DIR_CLOSE(dir) virDirClose(dir) int virFileMakePath(const char *path) G_GNUC_WARN_UNUSED_RESULT;