diff options
author | Chris Johns <chrisj@rtems.org> | 2014-05-29 15:05:56 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-06-04 22:32:55 +1000 |
commit | bb581906a68a07074a5b0bc6cb6698fe983ca3ca (patch) | |
tree | 21cdfe7a360964039699f6d0a26414906d0f0af5 /cpukit/libmisc/shell/main_logoff.c | |
parent | score: Rename _Scheduler_Update() (diff) | |
download | rtems-bb581906a68a07074a5b0bc6cb6698fe983ca3ca.tar.bz2 |
shell: Add rtems_shell_dup_current_env to get a default env.
Remove rtems_current_shell_env as this is dangerous because
the env can be NULL if used outside of a valid shell with the
POSIX key to an env set up.
Clean up the usage of rtems_current_shell_env.
Diffstat (limited to 'cpukit/libmisc/shell/main_logoff.c')
-rw-r--r-- | cpukit/libmisc/shell/main_logoff.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/libmisc/shell/main_logoff.c b/cpukit/libmisc/shell/main_logoff.c index 0535d092cb..e902744b6d 100644 --- a/cpukit/libmisc/shell/main_logoff.c +++ b/cpukit/libmisc/shell/main_logoff.c @@ -25,9 +25,12 @@ static int rtems_shell_main_logoff( char *argv[] __attribute__((unused)) ) { + rtems_shell_env_t *env = rtems_shell_get_current_env(); + printf("logoff from the system..."); - rtems_current_shell_env->exit_shell = true; + if (env) + env->exit_shell = true; return 0; } |