]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: replace '!= _UDEV_BUILTIN_INVALID' -> '>= 0' 36239/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 2 Feb 2025 04:08:53 +0000 (13:08 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 2 Feb 2025 04:09:18 +0000 (13:09 +0900)
No functional change, just refactoring.

src/udev/udev-dump.c
src/udev/udev-spawn.c

index 918c966c4e17530368bd4d26a1557d142f693dbe..1dcc14104276c1ea8664bbaae33525a85f0ab465 100644 (file)
@@ -121,7 +121,7 @@ void dump_event(UdevEvent *event, FILE *f) {
                 ORDERED_HASHMAP_FOREACH_KEY(val, command, event->run_list) {
                         UdevBuiltinCommand builtin_cmd = PTR_TO_UDEV_BUILTIN_CMD(val);
 
-                        if (builtin_cmd != _UDEV_BUILTIN_INVALID)
+                        if (builtin_cmd >= 0)
                                 fprintf(f, "  RUN{builtin} : %s\n", command);
                         else
                                 fprintf(f, "  RUN{program} : %s\n", command);
index 2d0f6455a572b145ab826eba32764b3c0e09bc13..22cb0089a44684a7ead2d141959a3e279f322f75 100644 (file)
@@ -343,7 +343,7 @@ void udev_event_execute_run(UdevEvent *event) {
         ORDERED_HASHMAP_FOREACH_KEY(val, command, event->run_list) {
                 UdevBuiltinCommand builtin_cmd = PTR_TO_UDEV_BUILTIN_CMD(val);
 
-                if (builtin_cmd != _UDEV_BUILTIN_INVALID) {
+                if (builtin_cmd >= 0) {
                         log_device_debug(event->dev, "Running built-in command \"%s\"", command);
                         r = udev_builtin_run(event, builtin_cmd, command);
                         if (r < 0)