aboutsummaryrefslogtreecommitdiff
path: root/networking/netstat.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-07-12 19:17:55 +0000
committerRob Landley <rob@landley.net>2006-07-12 19:17:55 +0000
commitc9c1a41c581101f53cc36efae53cd8ebb568962f (patch)
tree0aa4024f33e22567444f78d83d7d4b7986abe795 /networking/netstat.c
parent801ab140132a111e9524371c9b8d425579692389 (diff)
downloadbusybox-c9c1a41c581101f53cc36efae53cd8ebb568962f.tar.gz
A couple things that got tangled up in my tree, easier to check in both than
untangle them: Rewrite u_signal_names() into get_signum() and get_signame(), plus trim the signal list to that required by posix (they can specify the numbers for the rest if they really need them). (This is preparatory cleanup for adding a timeout applet like Roberto Foglietta wants.) Export the itoa (added due to Denis Vlasenko, although it's not quite his preferred implementation) from xfuncs.c so it's actually used, and remove several other redundant implementations of itoa and utoa() in the tree.
Diffstat (limited to 'networking/netstat.c')
-rw-r--r--networking/netstat.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/networking/netstat.c b/networking/netstat.c
index 4faa40cd4..6d91bb3f4 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -11,18 +11,8 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <unistd.h>
-#include "inet_common.h"
#include "busybox.h"
-#include "pwd_.h"
+#include "inet_common.h"
#ifdef CONFIG_ROUTE
extern void displayroutes(int noresolve, int netstatfmt);
@@ -87,19 +77,6 @@ typedef enum {
#define SO_WAITDATA (1<<17) /* wait data to read */
#define SO_NOSPACE (1<<18) /* no space to write */
-static char *itoa(unsigned int i)
-{
- /* 21 digits plus null terminator, good for 64-bit or smaller ints */
- static char local[22];
- char *p = &local[21];
- *p-- = '\0';
- do {
- *p-- = '0' + i % 10;
- i /= 10;
- } while (i > 0);
- return p + 1;
-}
-
static char *get_sname(int port, const char *proto, int num)
{
char *str=itoa(ntohs(port));