logger: Use 'rb' mode for freopen

Windows platform needs "rb" mode to read binary file,
otherwise after read 0x1A EOF will be. See:
https://stackoverflow.com/questions/11717120/unexpected-return-value-from-fread

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit is contained in:
Karol Trzcinski 2020-09-25 08:28:25 +02:00 committed by Liam Girdwood
parent adc447e8e4
commit 1e26ff4dc7
1 changed files with 1 additions and 1 deletions

View File

@ -640,7 +640,7 @@ static int logger_read(void)
ret = fread(&dma_log, sizeof(dma_log), 1, global_config->in_fd); ret = fread(&dma_log, sizeof(dma_log), 1, global_config->in_fd);
if (!ret) { if (!ret) {
if (global_config->trace && !ferror(global_config->in_fd)) { if (global_config->trace && !ferror(global_config->in_fd)) {
if (freopen(NULL, "r", global_config->in_fd)) { if (freopen(NULL, "rb", global_config->in_fd)) {
continue; continue;
} else { } else {
log_err("in %s(), freopen(..., %s) failed: %s(%d)\n", log_err("in %s(), freopen(..., %s) failed: %s(%d)\n",