mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-25 20:16:14 -05:00
Fix Avahi mDNS backend
Fix Avahi polling: - use avahi_simple_poll_loop() in rend-avahi.c:rend_poll() instead of reinventing yet another type of wheel; - start RendezVous thread after daemonizing, so the thread actually runs after we've daemonized. Also handle Avahi daemon restarts, as it's good practice and easy to do. ... And /that/, my friends, is how we do that ...
This commit is contained in:
12
src/main.c
12
src/main.c
@@ -469,6 +469,12 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
runas = conf_alloc_string("general","runas","nobody");
|
||||
|
||||
if(!os_init(config.foreground,runas)) {
|
||||
DPRINTF(E_LOG,L_MAIN,"Could not initialize server\n");
|
||||
os_deinit();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if(config.use_mdns) {
|
||||
DPRINTF(E_LOG,L_MAIN,"Starting rendezvous daemon\n");
|
||||
if(rend_init(runas)) {
|
||||
@@ -477,12 +483,6 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if(!os_init(config.foreground,runas)) {
|
||||
DPRINTF(E_LOG,L_MAIN,"Could not initialize server\n");
|
||||
os_deinit();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
free(runas);
|
||||
|
||||
#ifdef UPNP
|
||||
|
||||
Reference in New Issue
Block a user