Return -EINVAL from _from_string() functions
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 18 Jan 2019 15:26:31 +0000 (16:26 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Feb 2021 13:46:59 +0000 (14:46 +0100)
commit751db3b4cd09ba7f9352444b93600992493cbf28
treeb88b4172ee5884dd40ea94971c812810d338551a
parent2d93c20e5f600a9f1e4b617123577acf6ce5faa0
Return -EINVAL from _from_string() functions

We'd return -1 (-EPERM), even though we have a general rule to use real errno
values. The particular case that caught my attention was:

$ sudo udevadm control -l asdf
Failed to parse log priority 'asdf': Operation not permitted

... but "git grep 'r =.*_from_string' src/" return 110 hits. Confusingly, some
of the _from_string functions already return a proper errno value, so not all
of those are broken, but probably quite a few.
src/basic/string-table.c
src/basic/string-table.h
src/shared/test-tables.h
src/test/test-process-util.c
src/test/test-rlimit-util.c