Skip to content

Commit

Permalink
Make sure to flush when using print. (#2640)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch authored Nov 21, 2024
1 parent 0d19b59 commit 93b092a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/primitive_core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ static Object* write_on_std(const uint8* bytes, size_t length, bool is_stdout, b
fwrite_unlocked(bytes, 1, length, stream);
if (newline) {
fputc_unlocked('\n', stream);
} else {
fflush_unlocked(stream);
}
fflush_unlocked(stream);
funlockfile(stream);
return process->null_object();
}
Expand All @@ -147,9 +146,8 @@ static Object* write_on_std(const uint8* bytes, size_t length, bool is_stdout, b
fwrite(bytes, 1, length, stream);
if (newline) {
fputc('\n', stream);
} else {
fflush(stream);
}
fflush(stream);
return process->null_object();
}

Expand Down

0 comments on commit 93b092a

Please sign in to comment.