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:
parent
a113002214
commit
ff03bfa508
@ -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':
|
||||
|
@ -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':
|
||||
|
Loading…
x
Reference in New Issue
Block a user