summaryrefslogtreecommitdiffstats
path: root/gatchat
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-01-19 16:48:04 -0800
committerMarcel Holtmann <marcel@holtmann.org>2014-01-19 16:48:04 -0800
commitf83233d295a69d585b1da39c526463d0e1091175 (patch)
treeb66a157f04f13b6789345cd92122c15419a84924 /gatchat
parentc2e58405ee41190f18d6588c1626ba8dfd2a3a7e (diff)
downloadofono-f83233d295a69d585b1da39c526463d0e1091175.tar.bz2
gatchat: Fix handling of WRITE_SCHEDULER_DEBUG
Diffstat (limited to 'gatchat')
-rw-r--r--gatchat/gatchat.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index ebecd4be..aaf6e9b1 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -835,6 +835,9 @@ static gboolean can_write_data(gpointer data)
gsize len;
char *cr;
gboolean wakeup_first = FALSE;
+#ifdef WRITE_SCHEDULER_DEBUG
+ int limiter;
+#endif
/* Grab the first command off the queue and write as
* much of it as we can
@@ -886,13 +889,20 @@ static gboolean can_write_data(gpointer data)
towrite = cr - (cmd->cmd + chat->cmd_bytes_written) + 1;
#ifdef WRITE_SCHEDULER_DEBUG
- if (towrite > 5)
- towrite = 5;
+ limiter = towrite;
+
+ if (limiter > 5)
+ limiter = 5;
#endif
bytes_written = g_at_io_write(chat->io,
cmd->cmd + chat->cmd_bytes_written,
- towrite);
+#ifdef WRITE_SCHEDULER_DEBUG
+ limiter
+#else
+ towrite
+#endif
+ );
if (bytes_written == 0)
return FALSE;