From: idgay Date: Mon, 16 Jul 2007 15:58:16 +0000 (+0000) Subject: non-blocking read fix from Steve McKown X-Git-Tag: release_tools_1_2_4_1~28 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=bee7eba2654ceb34de5a6d29399e6dc6c5d4a9b5 non-blocking read fix from Steve McKown --- diff --git a/support/sdk/c/serialsource.c b/support/sdk/c/serialsource.c index 2da6968c..4e4afabd 100644 --- a/support/sdk/c/serialsource.c +++ b/support/sdk/c/serialsource.c @@ -627,11 +627,11 @@ void *read_serial_packet(serial_source src, int *len) the serial source is in non-blocking mode */ { + read_and_process(src, TRUE); for (;;) { struct packet_list *entry; - read_and_process(src, src->non_blocking); entry = pop_protocol_packet(src, P_PACKET_NO_ACK); if (entry) { @@ -645,6 +645,7 @@ void *read_serial_packet(serial_source src, int *len) if (src->non_blocking && serial_source_empty(src)) return NULL; source_wait(src, NULL); + read_and_process(src, src->non_blocking); } }