diff options
Diffstat (limited to 'networking/netstat.c')
-rw-r--r-- | networking/netstat.c | 25 |
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 @@ | |||
11 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 11 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <stdio.h> | ||
15 | #include <stdlib.h> | ||
16 | #include <string.h> | ||
17 | #include <stdarg.h> | ||
18 | #include <signal.h> | ||
19 | #include <errno.h> | ||
20 | #include <sys/stat.h> | ||
21 | #include <dirent.h> | ||
22 | #include <unistd.h> | ||
23 | #include "inet_common.h" | ||
24 | #include "busybox.h" | 14 | #include "busybox.h" |
25 | #include "pwd_.h" | 15 | #include "inet_common.h" |
26 | 16 | ||
27 | #ifdef CONFIG_ROUTE | 17 | #ifdef CONFIG_ROUTE |
28 | extern void displayroutes(int noresolve, int netstatfmt); | 18 | extern void displayroutes(int noresolve, int netstatfmt); |
@@ -87,19 +77,6 @@ typedef enum { | |||
87 | #define SO_WAITDATA (1<<17) /* wait data to read */ | 77 | #define SO_WAITDATA (1<<17) /* wait data to read */ |
88 | #define SO_NOSPACE (1<<18) /* no space to write */ | 78 | #define SO_NOSPACE (1<<18) /* no space to write */ |
89 | 79 | ||
90 | static char *itoa(unsigned int i) | ||
91 | { | ||
92 | /* 21 digits plus null terminator, good for 64-bit or smaller ints */ | ||
93 | static char local[22]; | ||
94 | char *p = &local[21]; | ||
95 | *p-- = '\0'; | ||
96 | do { | ||
97 | *p-- = '0' + i % 10; | ||
98 | i /= 10; | ||
99 | } while (i > 0); | ||
100 | return p + 1; | ||
101 | } | ||
102 | |||
103 | static char *get_sname(int port, const char *proto, int num) | 80 | static char *get_sname(int port, const char *proto, int num) |
104 | { | 81 | { |
105 | char *str=itoa(ntohs(port)); | 82 | char *str=itoa(ntohs(port)); |