From: Simon Glass Date: Sun, 27 Mar 2022 20:26:14 +0000 (-0600) Subject: sandbox: Correct loss of early output in SPL X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=830d73b4de41a3bfd20bf0bfdfe0189214340ed4;p=u-boot.git sandbox: Correct loss of early output in SPL At present fputc() is used before the console is available, then write() is used. These are not compatible. Since fputc() buffers internally it is better to use the write(), so that a partial line is immediately displayed. This has a slight effect on performance, but we are already using write() for the vast majority of the output with no obvious impacts. Signed-off-by: Simon Glass --- diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index d83c862182..5ea5417917 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -644,7 +644,7 @@ int os_get_filesize(const char *fname, long long *size) void os_putc(int ch) { - fputc(ch, stdout); + os_write(1, &ch, 1); } void os_puts(const char *str)