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/ifconfig/ifconfig.c | |
parent | Simplify getopt() to getopt_r() translation (diff) | |
download | rtems-libbsd-d01564c473842adfd93148bb367fa0679f99e6b8.tar.bz2 |
Move program control to thread structure
Diffstat (limited to 'freebsd/sbin/ifconfig/ifconfig.c')
-rw-r--r-- | freebsd/sbin/ifconfig/ifconfig.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/freebsd/sbin/ifconfig/ifconfig.c b/freebsd/sbin/ifconfig/ifconfig.c index c8a296ee..d983862d 100644 --- a/freebsd/sbin/ifconfig/ifconfig.c +++ b/freebsd/sbin/ifconfig/ifconfig.c @@ -115,25 +115,6 @@ static struct afswtch *af_getbyfamily(int af); static void af_other_status(int); #ifdef __rtems__ -static int main_ifconfig(int argc, char *argv[]); -static int rtems_shell_main_ifconfig(int argc, char *argv[]) -{ - rtems_shell_globals_t ifconfig_globals; - rtems_shell_globals = &ifconfig_globals; - memset (rtems_shell_globals, 0, sizeof (ifconfig_globals)); - descr = NULL; - descrlen = 64; - newaddr = 1; - supmedia = 0; - printkeys = 0; - ifconfig_globals.exit_code = 1; - if (setjmp (ifconfig_globals.exit_jmp) == 0) - return main_ifconfig ( argc, argv); - return ifconfig_globals.exit_code; -} -#endif - -#ifdef __rtems__ static struct ifconfig_option *opts = NULL; void @@ -182,12 +163,23 @@ usage(void) } #ifdef __rtems__ -int -main_ifconfig(int argc, char *argv[]) -#else +#include <machine/rtems-bsd-program.h> + +static int main(int argc, char *argv[]); + +static int rtems_shell_main_ifconfig(int argc, char *argv[]) +{ + descr = NULL; + descrlen = 64; + newaddr = 1; + supmedia = 0; + printkeys = 0; + + return rtems_bsd_program_call_main("ifconfig", main, argc, argv); +} +#endif /* __rtems__ */ int main(int argc, char *argv[]) -#endif { int c, all, namesonly, downonly, uponly; const struct afswtch *afp = NULL; |