log: properly return -EINVAL from log_set_max_level_from_string()

If we just return the value we got from log_level_from_string() on
failure we'll return -1, which is not a proper error code.

log_set_target_from_string() did get this right already, hence let's fix
this here too.
This commit is contained in:
Lennart Poettering 2015-09-30 14:16:40 +02:00
parent d8fc6a000f
commit 737af7347c

View file

@ -922,7 +922,7 @@ int log_set_max_level_from_string(const char *e) {
t = log_level_from_string(e);
if (t < 0)
return t;
return -EINVAL;
log_set_max_level(t);
return 0;