change DIR* int g_autoptr(DIR) where appropriate

All of these conversions are trivial - VIR_DIR_CLOSE() (aka
virDirClose()) is called only once on the DIR*, and it happens just
before going out of scope.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Laine Stump
2020-10-25 17:50:51 -04:00
parent a61472aad8
commit c0ae4919e3
34 changed files with 61 additions and 132 deletions

View File

@@ -374,7 +374,7 @@ int virHostValidateIOMMU(const char *hvname,
} else if (ARCH_IS_PPC64(arch)) {
/* Empty Block */
} else if (ARCH_IS_S390(arch)) {
DIR *dir;
g_autoptr(DIR) dir = NULL;
/* On s390x, we skip the IOMMU check if there are no PCI
* devices (which is quite usual on s390x). If there are
@@ -383,7 +383,6 @@ int virHostValidateIOMMU(const char *hvname,
if (!virDirOpen(&dir, "/sys/bus/pci/devices"))
return 0;
rc = virDirRead(dir, &dent, NULL);
VIR_DIR_CLOSE(dir);
if (rc <= 0)
return 0;
} else {