[libdmapsharing] Rearrange error handling in create_services()



commit d0c6218222b97886a009767ade17a202562ddd21
Author: W. Michael Petullo <mike flyn org>
Date:   Fri Apr 29 09:50:06 2011 -0500

    Rearrange error handling in create_services()
    
    See also https://bugzilla.gnome.org/show_bug.cgi?id=648925.
    Signed-off-by: W. Michael Petullo <mike flyn org>

 libdmapsharing/dmap-mdns-publisher-avahi.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/libdmapsharing/dmap-mdns-publisher-avahi.c b/libdmapsharing/dmap-mdns-publisher-avahi.c
index ced84ce..45d8594 100644
--- a/libdmapsharing/dmap-mdns-publisher-avahi.c
+++ b/libdmapsharing/dmap-mdns-publisher-avahi.c
@@ -177,23 +177,24 @@ create_services (DMAPMdnsPublisher * publisher, GError ** error)
 			avahi_entry_group_new (publisher->priv->client,
 					       (AvahiEntryGroupCallback)
 					       entry_group_cb, publisher);
+
+		if (publisher->priv->entry_group == NULL) {
+			g_debug ("Could not create AvahiEntryGroup for publishing");
+			g_set_error (error,
+				     DMAP_MDNS_PUBLISHER_ERROR,
+				     DMAP_MDNS_PUBLISHER_ERROR_FAILED,
+				     "%s",
+				     _
+				     ("Could not create AvahiEntryGroup for publishing"));
+			return FALSE;
+		}
+
 		dmap_mdns_avahi_set_entry_group (publisher->
 						 priv->entry_group);
 	} else {
 		avahi_entry_group_reset (publisher->priv->entry_group);
 	}
 
-	if (publisher->priv->entry_group == NULL) {
-		g_warning ("Could not create AvahiEntryGroup for publishing");
-		g_set_error (error,
-			     DMAP_MDNS_PUBLISHER_ERROR,
-			     DMAP_MDNS_PUBLISHER_ERROR_FAILED,
-			     "%s",
-			     _
-			     ("Could not create AvahiEntryGroup for publishing"));
-		return FALSE;
-	}
-
 	for (ptr = publisher->priv->service; ptr; ptr = g_slist_next (ptr)) {
 		if (!create_service (ptr->data, publisher, error)) {
 			return FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]