Handle stray avahi_entry_group_new error

This occurs if avahi user service publishing is disabled.
This commit is contained in:
ckie
2023-10-12 22:46:03 +02:00
committed by xytovl
parent 1b44880f3d
commit ae02f3b060
+6
View File
@@ -21,6 +21,12 @@ void avahi_publisher::create_service(AvahiClient * client)
if (!entry_group)
{
entry_group = avahi_entry_group_new(client, avahi_entry_group_callback, nullptr);
if (!entry_group)
{
std::cerr << "Cannot create entry group, you may need to remove disable-user-service-publishing from your avahi daemon config: "
<< avahi_strerror(avahi_client_errno(client)) << std::endl;
abort();
}
}
avahi_entry_group_reset(entry_group);