mirror of https://github.com/thesofproject/sof.git
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:
parent
adc447e8e4
commit
1e26ff4dc7
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue