gattrib: Fix ignoring the error message when write fails

If an error happens during writing to the socket, we should complain
that it failed.
This commit is contained in:
Vinicius Costa Gomes 2012-10-10 20:34:58 -03:00 committed by Johan Hedberg
parent 3665ba4403
commit 4c3dec8abf

View File

@ -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);