1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
19268: shell_lock: don't set CONFIG_SHELL_SHUTDOWN_ON_EXIT r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
This commit is contained in:
bors[bot] 2023-05-27 22:23:54 +00:00 committed by GitHub
commit d58f2c8501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 6 deletions

View File

@ -50,7 +50,7 @@ extern "C" {
* Instead terminate RIOT, which is also the behavior a user would
* expect from a CLI application.
*/
# if defined(CPU_NATIVE)
# if defined(CPU_NATIVE) && !IS_ACTIVE(MODULE_SHELL_LOCK)
# define CONFIG_SHELL_SHUTDOWN_ON_EXIT 1
# else
# define CONFIG_SHELL_SHUTDOWN_ON_EXIT 0

View File

@ -68,6 +68,11 @@ void shell_lock_checkpoint(char *line_buf, int buf_size);
*/
bool shell_lock_is_locked(void);
/**
* @brief Lock the shell
*/
void shell_lock_do_lock(void);
#ifdef MODULE_SHELL_LOCK_AUTO_LOCKING
/**
* @brief Restart the timeout interval before the shell is locked

View File

@ -501,6 +501,9 @@ void shell_run_once(const shell_command_t *shell_commands,
switch (res) {
case EOF:
if (IS_USED(MODULE_SHELL_LOCK)) {
shell_lock_do_lock();
}
return;
case -ENOBUFS:

View File

@ -143,10 +143,15 @@ static void _login_barrier(char *line_buf, size_t buf_size)
#ifdef MODULE_STDIO_TELNET
void telnet_cb_disconneced(void)
{
_shell_is_locked = true;
shell_lock_do_lock();
}
#endif
void shell_lock_do_lock(void)
{
_shell_is_locked = true;
}
#ifdef MODULE_SHELL_LOCK_AUTO_LOCKING
static void _shell_auto_lock_ztimer_callback(void *arg)
{

View File

@ -12,10 +12,6 @@ CFLAGS += -DCONFIG_SHELL_LOCK_PASSWORD=\"password\"
CFLAGS += -DCONFIG_SHELL_LOCK_AUTO_LOCK_TIMEOUT_MS=7000
endif
# This config defaults to 1 on native, such that pm_off() would be called as soon as
# shell_run_once is terminated in shell_run_forever. We do not want this behavior for this test.
CFLAGS += -DCONFIG_SHELL_SHUTDOWN_ON_EXIT=0
# test_utils_interactive_sync_shell assumes that the prompt is always '> ' which breaks
# with the password prompt of the shell_lock module which is different from the shell's prompt
DISABLE_MODULE += test_utils_interactive_sync_shell