From 8a3ea5bfff5a3b46b8fd6aa2153c924c5336fc3d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 11 Nov 2011 09:53:31 +1100 Subject: [PATCH] desktop: when in the CLI, use blocking writes this prevents us missing information from the logs --- libraries/Desktop/support/FastSerial.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/Desktop/support/FastSerial.cpp b/libraries/Desktop/support/FastSerial.cpp index 60542d51b3..fbb12ff6c7 100644 --- a/libraries/Desktop/support/FastSerial.cpp +++ b/libraries/Desktop/support/FastSerial.cpp @@ -295,11 +295,15 @@ void FastSerial::flush(void) void FastSerial::write(uint8_t c) { struct tcp_state *s = &tcp_state[_u2x]; + int flags = MSG_NOSIGNAL; check_connection(s); if (!s->connected) { return; } - send(s->fd, &c, 1, MSG_DONTWAIT | MSG_NOSIGNAL); + if (!desktop_state.slider) { + flags |= MSG_DONTWAIT; + } + send(s->fd, &c, 1, flags); } // Buffer management ///////////////////////////////////////////////////////////