1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00

core/device: Use DEVICE_NOT_FOUND instead of 0.

Use the enum name instead of the value zero. This is a noop change
as DEVICE_NOT_FOUND == 0.
This commit is contained in:
Daan De Meyer 2022-05-07 14:19:40 +02:00 committed by Luca Boccassi
parent f7ae43795c
commit b1ba0ce800
3 changed files with 5 additions and 5 deletions

View File

@ -885,7 +885,7 @@ static void device_remove_old_on_move(Manager *m, sd_device *dev) {
if (!syspath_old)
return (void) log_oom();
device_update_found_by_sysfs(m, syspath_old, 0, DEVICE_FOUND_MASK);
device_update_found_by_sysfs(m, syspath_old, DEVICE_NOT_FOUND, DEVICE_FOUND_MASK);
}
static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *userdata) {
@ -924,7 +924,7 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *
/* If we get notified that a device was removed by udev, then it's completely gone, hence
* unset all found bits */
device_update_found_by_sysfs(m, sysfs, 0, DEVICE_FOUND_MASK);
device_update_found_by_sysfs(m, sysfs, DEVICE_NOT_FOUND, DEVICE_FOUND_MASK);
} else if (device_is_ready(dev)) {
@ -941,7 +941,7 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *
} else
/* The device is nominally around, but not ready for us. Hence unset the udev bit, but leave
* the rest around. */
device_update_found_by_sysfs(m, sysfs, 0, DEVICE_FOUND_UDEV);
device_update_found_by_sysfs(m, sysfs, DEVICE_NOT_FOUND, DEVICE_FOUND_UDEV);
return 0;
}

View File

@ -2070,7 +2070,7 @@ static int mount_process_proc_self_mountinfo(Manager *m) {
continue;
/* Let the device units know that the device is no longer mounted */
device_found_node(m, what, 0, DEVICE_FOUND_MOUNT);
device_found_node(m, what, DEVICE_NOT_FOUND, DEVICE_FOUND_MOUNT);
}
return 0;

View File

@ -1249,7 +1249,7 @@ static int swap_process_proc_swaps(Manager *m) {
}
if (swap->what)
device_found_node(m, swap->what, 0, DEVICE_FOUND_SWAP);
device_found_node(m, swap->what, DEVICE_NOT_FOUND, DEVICE_FOUND_SWAP);
} else if (swap->just_activated) {