From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Subject: [PATCH 3/3] commands: readline: release command slice
Date: Wed, 10 Feb 2021 12:58:10 +0100 [thread overview]
Message-ID: <20210210115807.4223-3-r.czerwinski@pengutronix.de> (raw)
In-Reply-To: <20210210115807.4223-1-r.czerwinski@pengutronix.de>
Release the command slice around readline to let the workqueues run
while waiting for input.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
commands/readline.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/commands/readline.c b/commands/readline.c
index 796b4def95..ece25d12f5 100644
--- a/commands/readline.c
+++ b/commands/readline.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <environment.h>
#include <malloc.h>
+#include <slice.h>
#include <xfuncs.h>
static int do_readline(int argc, char *argv[])
@@ -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);
--
2.30.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2021-02-10 11:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 11:58 [PATCH 1/3] commands: readline: sort includes Rouven Czerwinski
2021-02-10 11:58 ` [PATCH 2/3] commands: readline: use exit code macros Rouven Czerwinski
2021-02-10 11:58 ` Rouven Czerwinski [this message]
2021-02-12 9:06 ` [PATCH 1/3] commands: readline: sort includes Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210210115807.4223-3-r.czerwinski@pengutronix.de \
--to=r.czerwinski@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox