mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user