aboutsummaryrefslogtreecommitdiff
path: root/src/ui_elements.c
diff options
context:
space:
mode:
authortoni <matzeton@googlemail.com>2016-07-04 01:35:41 +0200
committertoni <matzeton@googlemail.com>2016-07-04 01:35:41 +0200
commit3a8e6b979f6a741342546622477d8bd4e8483cce (patch)
tree6cdf20f45b641e12b33fbd6d6464f4a9def6e9f5 /src/ui_elements.c
parenta5026891c37cc19f27cc311252d7d5e8056bc337 (diff)
fixed SEM_UI post bug
Diffstat (limited to 'src/ui_elements.c')
-rw-r--r--src/ui_elements.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ui_elements.c b/src/ui_elements.c
index 535bc0c..f072d45 100644
--- a/src/ui_elements.c
+++ b/src/ui_elements.c
@@ -87,15 +87,16 @@ passwd_input_cb(WINDOW *wnd, void *data, int key)
ui_thrd_force_update();
sleep(2);
- ui_ipc_msgrecv(MQ_IF, ipc_buf);
-
- ui_thrd_suspend();
- set_txtwindow_color(infownd, COLOR_PAIR(4), COLOR_PAIR(4) | A_BOLD);
- set_txtwindow_title(infownd, "ERROR");
- set_txtwindow_text(infownd, ipc_buf);
- ui_thrd_resume();
- while (wgetch(stdscr) != '\n') { };
+ if (ui_ipc_msgcount(MQ_IF) > 0) {
+ ui_ipc_msgrecv(MQ_IF, ipc_buf);
+ ui_thrd_suspend();
+ set_txtwindow_color(infownd, COLOR_PAIR(4), COLOR_PAIR(4) | A_BOLD);
+ set_txtwindow_title(infownd, "ERROR");
+ set_txtwindow_text(infownd, ipc_buf);
+ ui_thrd_resume();
+ while (wgetch(stdscr) != '\n') { };
+ }
ui_thrd_suspend();
set_txtwindow_active(infownd, false);