Fixed building issues after merge
[cascardo/gnio.git] / gnio / gtcpclient.c
index fc54dc5..479cd00 100644 (file)
@@ -288,16 +288,16 @@ g_tcp_client_connect (GTcpClient    *client,
     }
 
   if (G_IS_INET4_ADDRESS (address))
-    client->priv->socket = g_socket_new (G_SOCKET_DOMAIN_INET, G_SOCKET_TYPE_STREAM, NULL, error);
+    client->priv->socket = g_socket_new (G_SOCKET_DOMAIN_INET, G_SOCKET_TYPE_STREAM, NULL);
   else if (G_IS_INET6_ADDRESS (address))
-    client->priv->socket = g_socket_new (G_SOCKET_DOMAIN_INET6, G_SOCKET_TYPE_STREAM, NULL, error);
+    client->priv->socket = g_socket_new (G_SOCKET_DOMAIN_INET6, G_SOCKET_TYPE_STREAM, NULL);
   else
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "unsupported address domain");
       return FALSE;
     }
 
-  if (!client->priv->socket)
+  if (g_socket_has_error (client->priv->socket, error))
     return FALSE;
 
   if (g_cancellable_set_error_if_cancelled (cancellable, error))
@@ -415,9 +415,9 @@ g_tcp_client_connect_async (GTcpClient          *client,
   address = g_inet_socket_address_get_address (client->priv->address);
 
   if (G_IS_INET4_ADDRESS (address))
-    client->priv->socket = g_socket_new (G_SOCKET_DOMAIN_INET, G_SOCKET_TYPE_STREAM, NULL, &error);
+    client->priv->socket = g_socket_new (G_SOCKET_DOMAIN_INET, G_SOCKET_TYPE_STREAM, NULL);
   else if (G_IS_INET6_ADDRESS (address))
-    client->priv->socket = g_socket_new (G_SOCKET_DOMAIN_INET6, G_SOCKET_TYPE_STREAM, NULL, &error);
+    client->priv->socket = g_socket_new (G_SOCKET_DOMAIN_INET6, G_SOCKET_TYPE_STREAM, NULL);
   else
     {
       g_simple_async_report_error_in_idle (G_OBJECT (client), callback, user_data, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "unsupported address domain");