diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-10-17 10:38:34 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-10-31 13:18:48 +0100 |
commit | d01564c473842adfd93148bb367fa0679f99e6b8 (patch) | |
tree | c838d184a92e6df21f32950392190e9b1842adf1 /freebsd/sbin/route/route.c | |
parent | Simplify getopt() to getopt_r() translation (diff) | |
download | rtems-libbsd-d01564c473842adfd93148bb367fa0679f99e6b8.tar.bz2 |
Move program control to thread structure
Diffstat (limited to '')
-rw-r--r-- | freebsd/sbin/route/route.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/freebsd/sbin/route/route.c b/freebsd/sbin/route/route.c index 509c5952..964188ff 100644 --- a/freebsd/sbin/route/route.c +++ b/freebsd/sbin/route/route.c @@ -116,24 +116,6 @@ 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; @@ -147,11 +129,17 @@ usage(cp) } #ifdef __rtems__ +#include <machine/rtems-bsd-program.h> + +static int main(int argc, char **argv); + +static int rtems_shell_main_route(int argc, char *argv[]) +{ + return rtems_bsd_program_call_main("route", main, argc, argv); +} +#endif /* __rtems__ */ int -main_route(argc, argv) -#else main(argc, argv) -#endif int argc; char **argv; { |