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/usr.bin | |
parent | Simplify getopt() to getopt_r() translation (diff) | |
download | rtems-libbsd-d01564c473842adfd93148bb367fa0679f99e6b8.tar.bz2 |
Move program control to thread structure
Diffstat (limited to 'freebsd/usr.bin')
-rw-r--r-- | freebsd/usr.bin/netstat/main.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/freebsd/usr.bin/netstat/main.c b/freebsd/usr.bin/netstat/main.c index d1714b6d..dc413942 100644 --- a/freebsd/usr.bin/netstat/main.c +++ b/freebsd/usr.bin/netstat/main.c @@ -361,15 +361,14 @@ int unit; /* unit number for above */ int af; /* address family */ int live; /* true if we are examining a live system */ - #ifdef __rtems__ -static int main_netstat(int argc, char *argv[]); +#include <machine/rtems-bsd-program.h> + +static int main(int argc, char *argv[]); + static int rtems_shell_main_netstat(int argc, char *argv[]) { int i; - rtems_shell_globals_t netstat_globals; - rtems_shell_globals = &netstat_globals; - memset (rtems_shell_globals, 0, sizeof (netstat_globals)); i = 0; protox[i].pr_index = N_TCBINFO; @@ -728,19 +727,11 @@ static int rtems_shell_main_netstat(int argc, char *argv[]) #endif noutputs = 0; - netstat_globals.exit_code = 1; - if (setjmp (netstat_globals.exit_jmp) == 0) - return main_netstat (argc, argv); - return netstat_globals.exit_code; + return rtems_bsd_program_call_main("netstat", main, argc, argv); } -#endif - +#endif /* __rtems__ */ int -#ifdef __rtems__ -main_netstat(int argc, char *argv[]) -#else main(int argc, char *argv[]) -#endif { struct protox *tp = NULL; /* for printing cblocks & stats */ int ch; |