GSocket: fix a couple of return values

g_socket_receive_with_blocking() and g_socket_send_with_blocking claim
to return -1 in error, their return type is gssize, and yet they
return FALSE if the initial g_return_val_if_fail() call fails.

https://bugzilla.gnome.org/show_bug.cgi?id=667226
This commit is contained in:
Claudio Saavedra 2012-01-04 00:18:59 +02:00
parent f38a1dbca7
commit 8b96fb3761

View File

@ -1837,7 +1837,7 @@ g_socket_receive_with_blocking (GSocket *socket,
{
gssize ret;
g_return_val_if_fail (G_IS_SOCKET (socket) && buffer != NULL, FALSE);
g_return_val_if_fail (G_IS_SOCKET (socket) && buffer != NULL, -1);
if (!check_socket (socket, error))
return -1;
@ -2009,7 +2009,7 @@ g_socket_send_with_blocking (GSocket *socket,
{
gssize ret;
g_return_val_if_fail (G_IS_SOCKET (socket) && buffer != NULL, FALSE);
g_return_val_if_fail (G_IS_SOCKET (socket) && buffer != NULL, -1);
if (!check_socket (socket, error))
return -1;