This will make it easier to review upcoming patches that use g_autoptr to auto-close all DIRs. Signed-off-by: Laine Stump <laine@xxxxxxxxxx> --- src/qemu/qemu_interop_config.c | 2 +- src/security/security_selinux.c | 6 ++---- src/util/virdevmapper.c | 2 +- src/util/virfile.c | 3 +-- tests/testutilsqemu.c | 5 ++--- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_interop_config.c b/src/qemu/qemu_interop_config.c index 53b251f056..7edca7540a 100644 --- a/src/qemu/qemu_interop_config.c +++ b/src/qemu/qemu_interop_config.c @@ -79,7 +79,7 @@ qemuBuildFileList(virHashTablePtr files, const char *dir) ret = 0; cleanup: - virDirClose(&dirp); + VIR_DIR_CLOSE(dirp); return ret; } diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 733bcf23d9..7d9e62a239 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -3487,8 +3487,7 @@ virSecuritySELinuxSetFileLabels(virSecurityManagerPtr mgr, virReportSystemError(errno, _("Unable to label files under %s"), path); - virDirClose(&dir); - + VIR_DIR_CLOSE(dir); return ret; } @@ -3532,8 +3531,7 @@ virSecuritySELinuxRestoreFileLabels(virSecurityManagerPtr mgr, virReportSystemError(errno, _("Unable to restore file labels under %s"), path); - virDirClose(&dir); - + VIR_DIR_CLOSE(dir); return ret; } diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c index 4d27c9f104..f26d36832a 100644 --- a/src/util/virdevmapper.c +++ b/src/util/virdevmapper.c @@ -211,7 +211,7 @@ virDMSanitizepath(const char *path) } } - virDirClose(&dh); + VIR_DIR_CLOSE(dh); return ret; } diff --git a/src/util/virfile.c b/src/util/virfile.c index 7d0a40b0fb..970d4bd234 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -2983,8 +2983,7 @@ int virFileChownFiles(const char *name, ret = 0; cleanup: - virDirClose(&dir); - + VIR_DIR_CLOSE(dir); return ret; } diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 4defba0b7b..278587767f 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -558,7 +558,7 @@ testQemuGetLatestCapsForArch(const char *arch, ret = g_strdup_printf("%s/%s", TEST_QEMU_CAPS_PATH, maxname); cleanup: - virDirClose(&dir); + VIR_DIR_CLOSE(dir); return ret; } @@ -667,8 +667,7 @@ testQemuCapsIterate(const char *suffix, ret = 0; cleanup: - virDirClose(&dir); - + VIR_DIR_CLOSE(dir); return ret; } -- 2.26.2