[grilo/0.1.x] grl-net: Fix a couple of WARNINGs



commit 80ad777b47a838b73fe5d6dcef12cf1064f2272f
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Jul 1 13:57:01 2011 +0000

    grl-net: Fix a couple of WARNINGs
    
    Seems the compiler is not able to detect that a variable in a #ifdef block has
    been initialized in a previous block.
    
    So let's merge both blocks.
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 libs/net/grl-net-wc.c |    8 +++-----
 libs/net/wc-test.c    |    4 +++-
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/libs/net/grl-net-wc.c b/libs/net/grl-net-wc.c
index 10ae228..775033f 100644
--- a/libs/net/grl-net-wc.c
+++ b/libs/net/grl-net-wc.c
@@ -730,6 +730,9 @@ grl_net_wc_request_finish (GrlNetWc *self,
     *length = rr->offset;
   }
 
+  g_object_unref (rr->request);
+  g_slice_free (RequestResult, rr);
+
 #else
   SoupMessage *msg = (SoupMessage *) g_simple_async_result_get_op_res_gpointer (res);
 
@@ -740,11 +743,6 @@ grl_net_wc_request_finish (GrlNetWc *self,
 #endif
 
 end_func:
-#ifdef LIBSOUP_USE_UNSTABLE_REQUEST_API
-  g_object_unref (rr->request);
-  g_slice_free (RequestResult, rr);
-#endif
-
   g_object_unref (res);
   return ret;
 }
diff --git a/libs/net/wc-test.c b/libs/net/wc-test.c
index 6313c67..5db1378 100644
--- a/libs/net/wc-test.c
+++ b/libs/net/wc-test.c
@@ -31,7 +31,9 @@ fetch_result (GObject *source,
                                   &error)) {
     g_print ("Error: %s\n", error->message);
   } else {
-    write (fileno (stdout), content, length);
+    if (write (fileno (stdout), content, length) < 0) {
+      g_print ("Error: unable to dump content on STDOUT\n");
+    }
   }
 
   g_idle_add (quit, source);



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