diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-02-10 22:19:41 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-02-18 18:21:25 +0100 |
commit | ff03bfa5080017bae850ec7f4ca5768f87bbd1e5 (patch) | |
tree | 5b92780cbb28540733aab07ce8798325865d54be /src/udev/udevadm-test.c | |
parent | a11300221482da7ffe7be2d75d508ddd411814f6 (diff) | |
download | systemd-ff03bfa5080017bae850ec7f4ca5768f87bbd1e5.tar.gz |
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)
Diffstat (limited to 'src/udev/udevadm-test.c')
-rw-r--r-- | src/udev/udevadm-test.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index bbee79c88e..7a30e25135 100644 --- a/src/udev/udevadm-test.c +++ b/src/udev/udevadm-test.c @@ -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': |