From: Lennart Poettering Date: Wed, 30 Sep 2015 12:16:40 +0000 (+0200) Subject: log: properly return -EINVAL from log_set_max_level_from_string() X-Git-Tag: v227.2^2~22 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=02313252e36e309776829312ab87e9a489e6572f 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. --- diff --git a/src/basic/log.c b/src/basic/log.c index 921c952f8..69977f15d 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -942,7 +942,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;