Skip to content

Commit 67957cd

Browse files
ktrzcinxjajanusz
authored andcommitted
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>
1 parent af4948b commit 67957cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/logger/convert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ static int logger_read(void)
640640
ret = fread(&dma_log, sizeof(dma_log), 1, global_config->in_fd);
641641
if (!ret) {
642642
if (global_config->trace && !ferror(global_config->in_fd)) {
643-
if (freopen(NULL, "r", global_config->in_fd)) {
643+
if (freopen(NULL, "rb", global_config->in_fd)) {
644644
continue;
645645
} else {
646646
log_err("in %s(), freopen(..., %s) failed: %s(%d)\n",

0 commit comments

Comments
 (0)