From f38a1dbca7d68eedc2d75cd7a7947c7217bbbd99 Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Wed, 4 Jan 2012 00:13:50 +0200 Subject: [PATCH] GSocket: add some more g_return_if_fail()s https://bugzilla.gnome.org/show_bug.cgi?id=667225 --- gio/gsocket.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gio/gsocket.c b/gio/gsocket.c index 661a91b..6bf1213 100644 --- a/gio/gsocket.c +++ b/gio/gsocket.c @@ -1727,6 +1727,8 @@ g_socket_check_connect_result (GSocket *socket, guint optlen; int value; + g_return_val_if_fail (G_IS_SOCKET (socket), FALSE); + if (!check_socket (socket, error)) return FALSE; @@ -2692,6 +2694,8 @@ GIOCondition g_socket_condition_check (GSocket *socket, GIOCondition condition) { + g_return_val_if_fail (G_IS_SOCKET (socket), 0); + if (!check_socket (socket, NULL)) return 0; @@ -2748,6 +2752,8 @@ g_socket_condition_wait (GSocket *socket, GCancellable *cancellable, GError **error) { + g_return_val_if_fail (G_IS_SOCKET (socket), FALSE); + if (!check_socket (socket, error)) return FALSE; @@ -2919,6 +2925,8 @@ g_socket_send_message (GSocket *socket, GOutputVector one_vector; char zero; + g_return_val_if_fail (G_IS_SOCKET (socket), -1); + if (!check_socket (socket, error)) return -1; @@ -3238,6 +3246,8 @@ g_socket_receive_message (GSocket *socket, GInputVector one_vector; char one_byte; + g_return_val_if_fail (G_IS_SOCKET (socket), -1); + if (!check_socket (socket, error)) return -1; -- 2.7.4