All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gatchat: fix canceling in progress commands
@ 2010-12-02 20:13 Vinicius Costa Gomes
  2010-12-07  2:49 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Vinicius Costa Gomes @ 2010-12-02 20:13 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 786 bytes --]

As g_queue_peek_head() returns the node data field, we have to compare
it against the actual command, not against the pointer to the queue node.
---
 gatchat/gatchat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index d82a02e..96da657 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -1060,7 +1060,7 @@ static gboolean at_chat_cancel(struct at_chat *chat, guint group, guint id)
 	if (c->gid != group)
 		return FALSE;
 
-	if (l == g_queue_peek_head(chat->command_queue) &&
+	if (c == g_queue_peek_head(chat->command_queue) &&
 			chat->cmd_bytes_written > 0) {
 		/* We can't actually remove it since it is most likely
 		 * already in progress, just null out the callback
-- 
1.7.3.2


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

end of thread, other threads:[~2010-12-07  2:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-02 20:13 [PATCH] gatchat: fix canceling in progress commands Vinicius Costa Gomes
2010-12-07  2:49 ` Denis Kenzior

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.