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:
+3
-4
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user