diff options
author | Rouven Czerwinski <r.czerwinski@pengutronix.de> | 2021-02-10 12:58:10 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-02-16 10:33:04 +0100 |
commit | ecd1539d9333c0d4a743555dc874ea7a83ee9ea7 (patch) | |
tree | 5627d25bb210f60d51d03465ea0ca8cd31ae89f2 | |
parent | f87ebc19da380403f85106efbd6d72cf49478b50 (diff) | |
download | barebox-ecd1539d9333c0d4a743555dc874ea7a83ee9ea7.tar.gz barebox-ecd1539d9333c0d4a743555dc874ea7a83ee9ea7.tar.xz |
commands: readline: release command slice
Release the command slice around readline to let the workqueues run
while waiting for input.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | commands/readline.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/readline.c b/commands/readline.c index 85b04a3903..403ac8563a 100644 --- a/commands/readline.c +++ b/commands/readline.c @@ -4,6 +4,7 @@ #include <common.h> #include <command.h> #include <malloc.h> +#include <slice.h> #include <xfuncs.h> #include <environment.h> @@ -14,11 +15,16 @@ static int do_readline(int argc, char *argv[]) if (argc < 3) return COMMAND_ERROR_USAGE; + command_slice_release(); + if (readline(argv[1], buf, CONFIG_CBSIZE) < 0) { + command_slice_acquire(); free(buf); return COMMAND_ERROR; } + command_slice_acquire(); + setenv(argv[2], buf); free(buf); |