All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/6] gattrib: Fix ignoring the error message when write fails
@ 2012-10-10 23:34 Vinicius Costa Gomes
  2012-10-10 23:34 ` [PATCH BlueZ 2/6] attrib: Remove all the usages of ATT_MAX_MTU Vinicius Costa Gomes
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Vinicius Costa Gomes @ 2012-10-10 23:34 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

If an error happens during writing to the socket, we should complain
that it failed.
---
 attrib/gattrib.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index 6f6942f..0806101 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -313,8 +313,14 @@ static gboolean can_write_data(GIOChannel *io, GIOCondition cond,
 
 	iostat = g_io_channel_write_chars(io, (gchar *) cmd->pdu, cmd->len,
 								&len, &gerr);
-	if (iostat != G_IO_STATUS_NORMAL)
+	if (iostat != G_IO_STATUS_NORMAL) {
+		if (gerr) {
+			error("%s", gerr->message);
+			g_error_free(gerr);
+		}
+
 		return FALSE;
+	}
 
 	if (cmd->expected == 0) {
 		g_queue_pop_head(queue);
-- 
1.7.12.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-11  6:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-10 23:34 [PATCH BlueZ 1/6] gattrib: Fix ignoring the error message when write fails Vinicius Costa Gomes
2012-10-10 23:34 ` [PATCH BlueZ 2/6] attrib: Remove all the usages of ATT_MAX_MTU Vinicius Costa Gomes
2012-10-10 23:35 ` [PATCH BlueZ 3/6] att: Replace ATT_MAX_MTU with ATT_MAX_VALUE_LEN Vinicius Costa Gomes
2012-10-10 23:35 ` [PATCH BlueZ 4/6] att: Fix sending pdu's with invalid data Vinicius Costa Gomes
2012-10-10 23:35 ` [PATCH BlueZ 5/6] attrib: Fix not checking if att_data_list_alloc fails Vinicius Costa Gomes
2012-10-10 23:35 ` [PATCH BlueZ 6/6] gas: Only do the Exchange MTU procedure over LE links Vinicius Costa Gomes
2012-10-11  6:57 ` [PATCH BlueZ 1/6] gattrib: Fix ignoring the error message when write fails Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.