From 4af3e9ad8aebd4ed73a6dc2db856f0018d9850a5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 1 Oct 2018 11:55:20 -0600 Subject: sandbox: Restore blocking I/O on exit At present sandbox sets non-blocking I/O as soon as any input is read from the terminal. However it does not restore the previous state on exit. Fix this and drop the old os_read_no_block() function. This means that we always enable blocking I/O in sandbox (if input is a terminal) whereas previously it would only happen on the first call to tstc() or getc(). However, the difference is likely not important. Signed-off-by: Simon Glass --- drivers/serial/sandbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/serial/sandbox.c') diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index 9e9bf3e011..4a05ea44ce 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -126,7 +126,7 @@ static int sandbox_serial_pending(struct udevice *dev, bool input) if (next_index == serial_buf_read) return 1; /* buffer full */ - count = os_read_no_block(0, &serial_buf[serial_buf_write], 1); + count = os_read(0, &serial_buf[serial_buf_write], 1); if (count == 1) serial_buf_write = next_index; -- cgit v1.2.1