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.
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;
}