1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-21 02:50:18 +03:00

udev: replace '!= _UDEV_BUILTIN_INVALID' -> '>= 0'

No functional change, just refactoring.
This commit is contained in:
Yu Watanabe 2025-02-02 13:08:53 +09:00
parent 5bb83e3f30
commit 7db4bdcd40
2 changed files with 2 additions and 2 deletions

View 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);

View 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)