Define FOREACH_DIRENT through FOREACH_DIRENT_ALL

As in the previous commit, 'de' is used as the iterator variable name.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-12-15 22:50:00 +01:00
parent c7f0d9e5ac
commit af3b864d76
31 changed files with 18 additions and 69 deletions
+3 -4
View File
@@ -98,7 +98,6 @@ static int detect_vm_device_tree(void) {
r = read_one_line_file("/proc/device-tree/hypervisor/compatible", &hvtype);
if (r == -ENOENT) {
_cleanup_closedir_ DIR *dir = NULL;
struct dirent *dent;
if (access("/proc/device-tree/ibm,partition-name", F_OK) == 0 &&
access("/proc/device-tree/hmc-managed?", F_OK) == 0 &&
@@ -114,9 +113,9 @@ static int detect_vm_device_tree(void) {
return -errno;
}
FOREACH_DIRENT(dent, dir, return -errno)
if (strstr(dent->d_name, "fw-cfg")) {
log_debug("Virtualization QEMU: \"fw-cfg\" present in /proc/device-tree/%s", dent->d_name);
FOREACH_DIRENT(de, dir, return -errno)
if (strstr(de->d_name, "fw-cfg")) {
log_debug("Virtualization QEMU: \"fw-cfg\" present in /proc/device-tree/%s", de->d_name);
return VIRTUALIZATION_QEMU;
}