From 737af7347c03a6ed2dfeea76647e9c1ca5b05a64 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 30 Sep 2015 14:16:40 +0200 Subject: 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. --- src/basic/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/log.c b/src/basic/log.c index 38f42b3a6e..e6d7d15182 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -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; -- cgit v1.2.3-54-g00ecf