diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-06-01 09:55:09 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-06-02 09:22:08 +0200 |
commit | f35e9b101d80c05d5a5eaece6e62e8eeb5743691 (patch) | |
tree | 328b0d97c49da87818c6ba4adc3e7cf061013846 /src/shared/varlink.c | |
parent | dissect: if dissecting without udev, don't look for usec timestamp on db record (diff) | |
download | systemd-f35e9b101d80c05d5a5eaece6e62e8eeb5743691.tar.xz systemd-f35e9b101d80c05d5a5eaece6e62e8eeb5743691.zip |
varlink: say "varlink:" instead of "n/a:" when no description is available
For new connections, we log something like this:
systemd[1]: n/a: New incoming connection.
systemd[1]: n/a: Connections of user 997: 0 (of 1024 max)
systemd[1]: varlink-22: varlink: setting state idle-server
systemd[1]: varlink-22: New incoming message: ...
This "n/a" is not very pretty, and without context it would be hard to even
figure out this is a varlink connection.
Diffstat (limited to '')
-rw-r--r-- | src/shared/varlink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/varlink.c b/src/shared/varlink.c index e77b144779..2542d90668 100644 --- a/src/shared/varlink.c +++ b/src/shared/varlink.c @@ -221,11 +221,11 @@ DEFINE_PRIVATE_STRING_TABLE_LOOKUP_TO_STRING(varlink_state, VarlinkState); log_debug("%s: " fmt, varlink_server_description(s), ##__VA_ARGS__) static inline const char *varlink_description(Varlink *v) { - return strna(v ? v->description : NULL); + return (v ? v->description : NULL) ?: "varlink"; } static inline const char *varlink_server_description(VarlinkServer *s) { - return strna(s ? s->description : NULL); + return (s ? s->description : NULL) ?: "varlink"; } static void varlink_set_state(Varlink *v, VarlinkState state) { |