summaryrefslogtreecommitdiff
path: root/src/zeroconf
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-05-25 21:32:23 +0200
committerMax Kellermann <max@musicpd.org>2021-05-25 21:34:09 +0200
commitdad1c21b59b123075c7fec48acf47c2fc8471e90 (patch)
tree8cd16c814aaf00ebafccb6f54aa523d31e043075 /src/zeroconf
parentdd10b2bd61db9b20f39a839ff22c76a8f0c70e48 (diff)
zeroconf/avahi: move variable declaration into "case"
Diffstat (limited to 'src/zeroconf')
-rw-r--r--src/zeroconf/ZeroconfAvahi.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/zeroconf/ZeroconfAvahi.cxx b/src/zeroconf/ZeroconfAvahi.cxx
index 466a29351..29e5f7ba8 100644
--- a/src/zeroconf/ZeroconfAvahi.cxx
+++ b/src/zeroconf/ZeroconfAvahi.cxx
@@ -157,8 +157,6 @@ MyAvahiClientCallback(AvahiClient *c, AvahiClientState state,
FormatDebug(avahi_domain, "Client changed to state %d", state);
switch (state) {
- int reason;
-
case AVAHI_CLIENT_S_RUNNING:
LogDebug(avahi_domain, "Client is RUNNING");
@@ -169,8 +167,8 @@ MyAvahiClientCallback(AvahiClient *c, AvahiClientState state,
break;
case AVAHI_CLIENT_FAILURE:
- reason = avahi_client_errno(c);
- if (reason == AVAHI_ERR_DISCONNECTED) {
+ if (int reason = avahi_client_errno(c);
+ reason == AVAHI_ERR_DISCONNECTED) {
LogNotice(avahi_domain,
"Client Disconnected, will reconnect shortly");
if (avahi_group != nullptr) {