From 4cf8ce30ba0523a81e1237c7970dfa22c52c1a39 Mon Sep 17 00:00:00 2001 From: Ban Siesta Date: Mon, 25 May 2015 19:10:05 +0100 Subject: [PATCH] fw_att_control: another ugly way to prevent a newline --- .../fw_att_control/fw_att_control_main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index d707449995..cb17728948 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -1149,14 +1149,17 @@ int fw_att_control_main(int argc, char *argv[]) err(1, "start failed"); } - /* avoid memory fragmentation by not exiting start handler until the task has fully started */ - while (att_control::g_control == nullptr || !att_control::g_control->task_running()) { - usleep(50000); - printf("."); - fflush(stdout); - } - printf("\n"); + /* check if the waiting is necessary at all */ + if (att_control::g_control == nullptr || !att_control::g_control->task_running()) { + /* avoid memory fragmentation by not exiting start handler until the task has fully started */ + while (att_control::g_control == nullptr || !att_control::g_control->task_running()) { + usleep(50000); + printf("."); + fflush(stdout); + } + printf("\n"); + } exit(0); }