btstack_stdin_posix: fix unused result warning

This commit is contained in:
Matthias Ringwald 2019-05-17 17:49:00 +02:00
parent 2d3020e7ab
commit 7fdcb0b5b7

View File

@ -58,10 +58,11 @@ static void stdin_process(btstack_data_source_t *ds, btstack_data_source_callbac
UNUSED(callback_type);
char data;
read(stdin_source.source.fd, &data, 1);
if (stdin_handler){
(*stdin_handler)(data);
}
int result = read(stdin_source.source.fd, &data, 1);
if (result < 1) return;
if (stdin_handler == NULL) return;
(*stdin_handler)(data);
}
void btstack_stdin_setup(void (*handler)(char c)){