diff options
author | Jörg Krause <joerg.krause@embedded.rocks> | 2016-11-24 12:34:11 +0100 |
---|---|---|
committer | Jörg Krause <joerg.krause@embedded.rocks> | 2016-11-24 14:46:59 +0100 |
commit | e5ec3da9da8020b1ca650e2ba54e626703187663 (patch) | |
tree | 42e748cb6c90129be52586bd030af2adce5fd44c /mdns_avahi.c | |
parent | 86a2902a45a201e34b8d06b1c1729b3ef7495568 (diff) |
mdns: avahi: set AVAHI_CLIENT_NO_FAIL in avahi_client_new()
For whatever reasons `avahi_client_new` passes the value `0` as its
second parameter. However, the second parameter is of type
[`AvahiClientFlags`](http://avahi.org/doxygen/html/client_8h_source.html#l00048)
with the possible values:
``` c
typedef enum {
AVAHI_CLIENT_IGNORE_USER_CONFIG = 1,
AVAHI_CLIENT_NO_FAIL = 2
} AvahiClientFlags;
```
Setting `AVAHI_CLIENT_NO_FAIL` has the benefit that the shairport-sync
daemon does not depend on the order of the init process whether the
avahi daemon is already up.
Diffstat (limited to 'mdns_avahi.c')
-rw-r--r-- | mdns_avahi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mdns_avahi.c b/mdns_avahi.c index 12df050..7fe6c18 100644 --- a/mdns_avahi.c +++ b/mdns_avahi.c @@ -273,7 +273,7 @@ static int avahi_register(char *srvname, int srvport) { return -1; } if (!(client = - avahi_client_new(avahi_threaded_poll_get(tpoll), 0, client_callback, NULL, &err))) { + avahi_client_new(avahi_threaded_poll_get(tpoll), AVAHI_CLIENT_NO_FAIL, client_callback, NULL, &err))) { warn("couldn't create avahi client: %s!", avahi_strerror(err)); return -1; } |