From c1a2bb4f836a1c96c8e39a67be9795d462ec3356 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 8 May 2021 06:59:56 -0600 Subject: console: Report an error when output buffer is exhausted If the console output buffer is exhausted, characters are silently dropped from the end. Detect this condition and report an error when reading back the characters. Signed-off-by: Simon Glass --- include/console.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/console.h') diff --git a/include/console.h b/include/console.h index 7e628c0cf8..f848bcbf03 100644 --- a/include/console.h +++ b/include/console.h @@ -72,7 +72,8 @@ int console_record_reset_enable(void); * * @str: Place to put string * @maxlen: Maximum length of @str including nul terminator - * @return length of string returned + * @return length of string returned, or -ENOSPC if the console buffer was + * overflowed by the output */ int console_record_readline(char *str, int maxlen); -- cgit v1.2.3