1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00

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); t = log_level_from_string(e);
if (t < 0) if (t < 0)
return t; return -EINVAL;
log_set_max_level(t); log_set_max_level(t);
return 0; return 0;