[rtems commit] shell: Move rtems_shell_init_environment() call

Sebastian Huber sebh at rtems.org
Thu Apr 7 05:47:56 UTC 2022


Module:    rtems
Branch:    master
Commit:    a800e4de124fa13c05067ca681df925106bfa7f9
Changeset: http://git.rtems.org/rtems/commit/?id=a800e4de124fa13c05067ca681df925106bfa7f9

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Apr  6 08:40:45 2022 +0200

shell: Move rtems_shell_init_environment() call

Move rtems_shell_init_environment() call to rtems_shell_set_shell_env()
since this function uses the POSIX key.

---

 cpukit/libmisc/shell/shell.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/libmisc/shell/shell.c b/cpukit/libmisc/shell/shell.c
index 090277c57c..c00883ba66 100644
--- a/cpukit/libmisc/shell/shell.c
+++ b/cpukit/libmisc/shell/shell.c
@@ -200,6 +200,8 @@ static bool rtems_shell_set_shell_env(
   rtems_shell_env_key_handle *handle;
   int eno;
 
+  rtems_shell_init_environment();
+
   handle = malloc(sizeof(rtems_shell_env_key_handle));
   if (handle == NULL) {
     rtems_error(0, "no memory for shell env key handle)");
@@ -1020,8 +1022,6 @@ bool rtems_shell_main_loop(
   FILE           *stdoutToClose = NULL;
   FILE           *line_editor_output;
 
-  rtems_shell_init_environment();
-
   if (shell_env->magic != SHELL_MAGIC) {
     rtems_error(0, "invalid shell environment passed to the main loop)");
     return false;



More information about the vc mailing list