Added rtems exit code to ping, route, and ifconfig commands.

The rtems shell commands should not exit but allow multiple
command attempts and some of the commands share code that
will exit.  For this reason a common exit routine was
provided and code added to err.h to address this.

allow access to it.
This commit is contained in:
Jennifer Averett
2012-10-16 13:38:09 -05:00
parent 6bf758668b
commit 99ae4eb50f
6 changed files with 112 additions and 5 deletions

View File

@@ -52,6 +52,19 @@
#include <sys/_types.h>
#endif
#ifdef __rtems__
#include <setjmp.h>
typedef struct rtems_shell_globals_s {
jmp_buf exit_jmp;
int exit_code;
} rtems_shell_globals_t;
extern rtems_shell_globals_t *rtems_shell_globals;
void rtems_shell_exit (int code);
#define exit rtems_shell_exit
#endif
__BEGIN_DECLS
void err(int, const char *, ...) __dead2 __printf0like(2, 3);
void verr(int, const char *, __va_list) __dead2 __printf0like(2, 0);