From 82a115fdec875d7e8dc601fe0e1b12859814c91c Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Mon, 2 Jul 2018 20:06:49 -0500 Subject: sandbox: Don't disable ctrlc() on sandbox if in raw mode In raw mode, handle ctrl-c as normal. This allows normal ctrl-c behavior such as aborting a command that is timing out without completely terminating the sandbox executable. In [1], Simon disabled this. His reason for it was that it interferes with piping test scripts. Piping should be done in cooked mode, so this change should still not interfere. [1] commit 8969ea3e9f2db04a6b3675 ("sandbox: Disable Ctrl-C") Signed-off-by: Joe Hershberger Reviewed-by: Simon Glass --- drivers/serial/sandbox.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/serial') diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index d2e007284c..a60dabe588 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -69,6 +70,9 @@ static int sandbox_serial_probe(struct udevice *dev) os_tty_raw(0, state->term_raw == STATE_TERM_RAW_WITH_SIGS); priv->start_of_line = 0; + if (state->term_raw != STATE_TERM_RAW) + disable_ctrlc(1); + return 0; } -- cgit