chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d883c5
)
log: properly return -EINVAL from log_set_max_level_from_string()
author
Lennart Poettering
<lennart@poettering.net>
Wed, 30 Sep 2015 12:16:40 +0000
(14:16 +0200)
committer
Sven Eden
<yamakuzure@gmx.net>
Wed, 29 Mar 2017 08:45:10 +0000
(10:45 +0200)
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
patch
|
blob
|
history
diff --git
a/src/basic/log.c
b/src/basic/log.c
index 921c952f833dff4c76e7f8ff0cea554021171065..69977f15d69ba657ea9faa01f7eea45f62e7f0ae 100644
(file)
--- 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;