Skip to content

Commit

Permalink
stdout was no longer line-buffered
Browse files Browse the repository at this point in the history
Fixed the problem that stdout was no longer line-buffered.

Fixes #35.
  • Loading branch information
smuehlst committed May 18, 2024
1 parent 3bd135d commit 3bb95a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/circle-newlib
12 changes: 12 additions & 0 deletions samples/05-smoketest/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,18 @@ CKernel::IoTest (void)
Report ("fork() is not implemented, fails as expected");
}

// Check fix for issue #35.
Report ("File descriptors 0, 1, 2 are character special files");

for (int fd = 0; fd < 3; fd += 1)
{
struct stat statbuf;
if (fstat(fd, &statbuf) == -1 || !S_ISCHR(statbuf.st_mode))
{
PErrorExit ("Check for S_ISCHR() on stdin/stdout/stderr failed");
}
};

Report ("Redirect stdout");

FILE * const redirected_stdout = freopen ("redirected_stdout.txt", "w", stdout);
Expand Down

0 comments on commit 3bb95a5

Please sign in to comment.