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

udevadm: after validating action, use our internal string instead of optarg

This doesn't really change anything, but feels nicer, since it abstracts
away what device_action_from_string()/device_action_to_string() do
internally, and always uses a normalized action string (yes, there's no
ambiguity, but it's nice to stay abstract, maybe one day there is
ambiguity around this)
This commit is contained in:
Lennart Poettering 2021-02-10 22:19:41 +01:00
parent a113002214
commit ff03bfa508
2 changed files with 3 additions and 4 deletions

View File

@ -63,10 +63,9 @@ static int parse_argv(int argc, char *argv[]) {
a = device_action_from_string(optarg);
if (a < 0)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Invalid action '%s'", optarg);
return log_error_errno(a, "Invalid action '%s'", optarg);
arg_action = optarg;
arg_action = device_action_to_string(a);
break;
}
case 'N':

View File

@ -222,7 +222,7 @@ int trigger_main(int argc, char *argv[], void *userdata) {
if (a < 0)
return log_error_errno(a, "Unknown action '%s'", optarg);
action = optarg;
action = device_action_to_string(a);
break;
}
case 's':