summaryrefslogtreecommitdiffstats
path: root/src/shared/varlink.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-10 09:57:59 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-05-10 16:55:37 +0200
commit77740b5993b9e6e000ca8378a67338931c35b506 (patch)
tree4edcef59df7bc6c86d62370d9f47f7492af93025 /src/shared/varlink.c
parentUse sd_event_source_disable_unref() (diff)
downloadsystemd-77740b5993b9e6e000ca8378a67338931c35b506.tar.xz
systemd-77740b5993b9e6e000ca8378a67338931c35b506.zip
journalctl: improve error messages
Follow-up for #12230.
Diffstat (limited to 'src/shared/varlink.c')
-rw-r--r--src/shared/varlink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/shared/varlink.c b/src/shared/varlink.c
index ceec1af0d4..5c5f5077f9 100644
--- a/src/shared/varlink.c
+++ b/src/shared/varlink.c
@@ -228,10 +228,15 @@ static inline const char *varlink_server_description(VarlinkServer *s) {
static void varlink_set_state(Varlink *v, VarlinkState state) {
assert(v);
+ assert(state >= 0 && state < _VARLINK_STATE_MAX);
- varlink_log(v, "varlink: changing state %s → %s",
- varlink_state_to_string(v->state),
- varlink_state_to_string(state));
+ if (v->state < 0)
+ varlink_log(v, "varlink: setting state %s",
+ varlink_state_to_string(state));
+ else
+ varlink_log(v, "varlink: changing state %s → %s",
+ varlink_state_to_string(v->state),
+ varlink_state_to_string(state));
v->state = state;
}