[PATCH 0/2] readline_simple: return -1 if getc fails

Gaël PORTAY gael.portay at savoirfairelinux.com
Mon Aug 7 15:10:40 PDT 2017


Dear maintainers,

I came accross this issue when I was trying to add support for a new MIPS
board.

The getc() function from console_simple.c returns -EINVAL when no console is
registered.

It causes readline_simple to print a non-printable character (-EINVAL in this
case). Furthermore, it causes an infinite loop: readline never returns.

	barebox:/ ���(...)���

With this patch, the error is no more explicit but the readline function stops
to print a dummy character and returns to shell.

	barebox:/ <INTERRUPT>
	barebox:/ <INTERRUPT>
	barebox:/ <INTERRUPT>
	(...)
	barebox:/ <INTERRUPT>
	barebox:/ <INTERRUPT>
	barebox:/ <INTERRUPT>

The second patch is a simple cleanup of the in-file documentation.

Regards,
Gaël PORTAY (2):
  readline_simple: return -1 if getc fails
  readline_simple: remove obsolete documentation

 lib/readline_simple.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
2.13.2




More information about the barebox mailing list