summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-08-06 13:30:25 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-08-10 11:47:55 +0200
commit515839577e4fa355f4633371a539d61100d90c34 (patch)
treea3bc3e280c292ddf12a121fac4f9b8f52036c8e0
parenteng: Add Doxyfile update to release process (diff)
downloadrtems-docs-515839577e4fa355f4633371a539d61100d90c34.tar.bz2
user: Add shell environment migration aid
-rw-r--r--user/migration/v4_11-to-v5.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/user/migration/v4_11-to-v5.rst b/user/migration/v4_11-to-v5.rst
index a0cab02..0e0fb46 100644
--- a/user/migration/v4_11-to-v5.rst
+++ b/user/migration/v4_11-to-v5.rst
@@ -126,3 +126,30 @@ interface name.
exit(1);
}
}
+
+Shell Environment
+-----------------
+
+To address resource leaks in the RTEMS shell, the management of shell
+environments changed. This change may break existing code. Here is an example
+how a broken Telnet shell can be fixed:
+
+. code-block:: c
+
+ static void
+ telnet_shell( char *name, void *arg )
+ {
+ rtems_shell_env_t env;
+
+ /* Previous WRONG approach: memset( &env, 0, sizeof( env) ); */
+
+ /* Correct way to initialize the shell environment */
+ rtems_shell_dup_current_env( &env );
+
+ env.devname = name;
+ env.taskname = "TLNT";
+ env.login_check = NULL;
+ env.forever = false;
+
+ rtems_shell_main_loop( &env );
+ }