]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/device: Use DEVICE_NOT_FOUND instead of 0.
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 7 May 2022 12:19:40 +0000 (14:19 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 7 May 2022 19:05:10 +0000 (20:05 +0100)
Use the enum name instead of the value zero. This is a noop change
as DEVICE_NOT_FOUND == 0.

src/core/device.c
src/core/mount.c
src/core/swap.c

index dd1f71d43c0da12e1443d19b71498c434c58b9ad..f65dbfcb1e7e82e34be70d06a5bd63c01275f239 100644 (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;
 }
index b4c058dff4b406c864b25334f2cb548b08bc316f..20b4bb6d2b8116c60df3e9ae189ab3d4f2e8b60b 100644 (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;
index 0de73970ad2600c7d1546e3ee2475931d8280e2a..222c76cf79c28438be431d42b58456c97c02f4cb 100644 (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) {