- if (state == AVAHI_CLIENT_S_RUNNING)
- /* The serve has startup successfully and registered its host
- * name on the network, so it's time to create our services */
- create_services(c);
-
- else if (state == AVAHI_CLIENT_S_COLLISION) {
- /* Let's drop our registered services. When the server is back
- * in AVAHI_SERVER_RUNNING state we will register them
- * again with the new host name. */
- if (group)
- avahi_entry_group_reset(group);
+ switch (state) {
+ case AVAHI_CLIENT_S_RUNNING:
+
+ /* The server has startup successfully and registered its host
+ * name on the network, so it's time to create our services */
+ if (!group)
+ create_services(c);
+ break;
+
+ case AVAHI_CLIENT_S_COLLISION: