]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Fix warnings in test program logs
authorRobert Ancell <robert.ancell@canonical.com>
Thu, 14 Jul 2016 02:58:40 +0000 (14:58 +1200)
committerRobert Ancell <robert.ancell@canonical.com>
Thu, 14 Jul 2016 02:58:40 +0000 (14:58 +1200)
tests/src/status.c

index e66e22bcb5abab4d4f4105dcd3a189ea1f635bc2..08258685c4b63d6e0d3babfad1455f3045528902 100644 (file)
@@ -29,15 +29,20 @@ status_request_cb (GSocket *socket, GIOCondition condition, gpointer data)
     n_read = g_socket_receive (socket, (gchar *)&length, sizeof (length), NULL, &error);
     if (n_read > 0)
         n_read = g_socket_receive (socket, buffer, length, NULL, &error);
+    if (error)
+    {
+        if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED))
+            n_read = 0;
+        else
+            g_warning ("Error reading from socket: %s", error->message);
+    }
+    g_clear_error (&error);
     if (n_read == 0)
     {
         if (request_func)
             request_func (NULL, NULL);
         return FALSE;
     }
-    if (error)
-        g_warning ("Error reading from socket: %s", error->message);
-    g_clear_error (&error);
 
     if (n_read <= 0 || !request_func)
         return TRUE;