Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #261, #312, and #362, OSAL build cleanup (multiple issues) #404

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update #404, Add DataLen>0 check in write loop
Avoids calling write() if length is zero.
  • Loading branch information
jphickey committed Apr 15, 2020
commit eeab72752471e205d55c2c952885d8a4afd0ca81
3 changes: 1 addition & 2 deletions src/bsp/pc-linux/src/bsp_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void OS_BSP_ConsoleOutput_Impl(const char *Str, uint32 DataLen)
{
ssize_t WriteLen;

do
while(DataLen > 0)
{
/* writes the raw data directly to STDOUT_FILENO (unbuffered) */
WriteLen = write(STDOUT_FILENO, Str, DataLen);
Expand All @@ -78,7 +78,6 @@ void OS_BSP_ConsoleOutput_Impl(const char *Str, uint32 DataLen)
Str += WriteLen;
DataLen -= WriteLen;
}
while(true);
}

/*----------------------------------------------------------------
Expand Down