From dc86e864463a61d3f99a21c948c11ba274c6ef84 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 2 May 2011 07:13:52 -0500 Subject: [PATCH] gathdlc: Make sure to set in_read_handler properly --- gatchat/gathdlc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c index 00d9daf0..e3ab7ec9 100644 --- a/gatchat/gathdlc.c +++ b/gatchat/gathdlc.c @@ -225,10 +225,6 @@ static void new_bytes(struct ring_buffer *rbuf, gpointer user_data) unsigned char *buf = ring_buffer_read_ptr(rbuf, 0); unsigned int pos = 0; - hdlc_record(hdlc->record_fd, TRUE, buf, wrap); - - hdlc->in_read_handler = TRUE; - /* * We delete the the paused_timeout_cb or hdlc_suspend as soons as * we read a data. @@ -246,6 +242,10 @@ static void new_bytes(struct ring_buffer *rbuf, gpointer user_data) return; } + hdlc_record(hdlc->record_fd, TRUE, buf, wrap); + + hdlc->in_read_handler = TRUE; + while (pos < len) { /* * We try to detect NO CARRIER conditions here. We