Skip to content

Commit

Permalink
util: declare g_autoptr cleanup function to auto-close DIR*
Browse files Browse the repository at this point in the history
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
  • Loading branch information
Laine Stump committed Nov 3, 2020
1 parent 24d8968 commit a61472a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/util/virfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a61472a

Please sign in to comment.