Skip to content
Merged
Changes from all commits
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
18 changes: 18 additions & 0 deletions fsw/pc-linux/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,24 @@ void OS_Application_Startup(void)
*/
memset(&(CommandData), 0, sizeof(CFE_PSP_CommandData_t));

/*
* Set console output to unbuffered
*
* This PSP uses "printf()" calls before OSAL is initialized,
* then changes to OS_printf(). Lines in OS_printf() are buffered
* by OSAL and then directly written to the STDOUT_FILENO.
*
* This can cause unexpected behavior where the early calls to
* printf() are seen after the OS_printf() calls, because they
* are being buffered in stdio. This is especially true if the
* output is directed to a log file or pipe, where block buffering
* is the default, as opposed to line buffering.
*
* As the only usage of stdout is in the early log messages,
* turning off buffering should not have any real downside.
*/
setbuf(stdout, NULL);

/*
** Process the arguments with getopt_long(), then
** start the cFE
Expand Down
Loading