From c35c5d3ca9619d4750a1d8c8e25c4102f690043f Mon Sep 17 00:00:00 2001 From: Bob Date: Sun, 9 Feb 2014 23:50:39 +0100 Subject: [PATCH] fixed: race condition --- src/ampswitch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ampswitch.cpp b/src/ampswitch.cpp index e2d08e7..62380b4 100644 --- a/src/ampswitch.cpp +++ b/src/ampswitch.cpp @@ -156,10 +156,10 @@ void CAmpSwitch::Process() printf("switching off, executing \"%s\"\n", m_offcommand); system(m_offcommand); } - } - uint8_t byte; - while (read(m_pipe[0], &byte, 1) == 1); + uint8_t byte; + while (read(m_pipe[0], &byte, 1) == 1); + } } }