diff options
author | Jennifer Averett <jennifer.averett@oarcorp.com> | 2012-10-16 13:38:09 -0500 |
---|---|---|
committer | Jennifer Averett <jennifer.averett@oarcorp.com> | 2012-10-16 13:38:09 -0500 |
commit | 99ae4eb50f2bcc9d836a43e8d319e72266d75d10 (patch) | |
tree | 2768b7bd8e164bace8d10d83295f685b3ddac08c /freebsd-userspace/commands/sbin/route/route.c | |
parent | Add if_nametoindex() (diff) | |
download | rtems-libbsd-99ae4eb50f2bcc9d836a43e8d319e72266d75d10.tar.bz2 |
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.
Diffstat (limited to '')
-rw-r--r-- | freebsd-userspace/commands/sbin/route/route.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/freebsd-userspace/commands/sbin/route/route.c b/freebsd-userspace/commands/sbin/route/route.c index d3f20bc1..8099d4c4 100644 --- a/freebsd-userspace/commands/sbin/route/route.c +++ b/freebsd-userspace/commands/sbin/route/route.c @@ -80,6 +80,7 @@ static const char rcsid[] = #endif #endif + struct keytab { char *kt_cp; int kt_i; @@ -124,6 +125,24 @@ extern char *iso_ntoa(); void usage(const char *) __dead2; +#ifdef __rtems__ + +static int main_route(int argc, char **argv); + +static int rtems_shell_main_route(int argc, char *argv[]) +{ + rtems_shell_globals_t route_globals; + rtems_shell_globals = &route_globals; + memset (rtems_shell_globals, 0, sizeof (route_globals)); + route_globals.exit_code = 1; + if (setjmp (route_globals.exit_jmp) == 0) + return main_route ( argc, argv); + return route_globals.exit_code; +} + +#endif + + void usage(cp) const char *cp; @@ -1703,7 +1722,7 @@ atalk_ntoa(struct at_addr at) "route", /* name */ "route [args]", /* usage */ "net", /* topic */ - main_route, /* command */ + rtems_shell_main_route, /* command */ NULL, /* alias */ NULL /* next */ }; |