diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-01-27 08:24:39 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-01-27 08:24:39 +0000 |
commit | 291ba71b7972a0cb09f66510b171c7a4ce6bce36 (patch) | |
tree | ecb05ce51890c2cf84ad036543a972ac812320c3 /networking | |
parent | 855b936df80965a68c834ed7a494e4d5cc1cc1e1 (diff) | |
download | busybox-w32-291ba71b7972a0cb09f66510b171c7a4ce6bce36.tar.gz busybox-w32-291ba71b7972a0cb09f66510b171c7a4ce6bce36.tar.bz2 busybox-w32-291ba71b7972a0cb09f66510b171c7a4ce6bce36.zip |
Fix header file usage -- there were many unnecessary header files included in
busybox.h which slowed compiles. I left only what was needed and then fixed up
all the apps to include their own header files. I also fixed naming for pwd.h
and grp.h functions. Tested to compile and run with libc5, glibc, and uClibc.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@1695 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
-rw-r--r-- | networking/hostname.c | 3 | ||||
-rw-r--r-- | networking/nslookup.c | 3 | ||||
-rw-r--r-- | networking/ping.c | 5 | ||||
-rw-r--r-- | networking/wget.c | 16 |
4 files changed, 22 insertions, 5 deletions
diff --git a/networking/hostname.c b/networking/hostname.c index b1f061369..a789fa0f1 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: hostname.c,v 1.20 2001/01/24 18:44:54 andersen Exp $ | 3 | * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $ |
4 | * Mini hostname implementation for busybox | 4 | * Mini hostname implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -28,6 +28,7 @@ | |||
28 | #include <arpa/inet.h> | 28 | #include <arpa/inet.h> |
29 | #include <netdb.h> | 29 | #include <netdb.h> |
30 | #include <unistd.h> | 30 | #include <unistd.h> |
31 | #include <string.h> | ||
31 | #include <stdio.h> | 32 | #include <stdio.h> |
32 | 33 | ||
33 | void do_sethostname(char *s, int isfile) | 34 | void do_sethostname(char *s, int isfile) |
diff --git a/networking/nslookup.c b/networking/nslookup.c index 271518f22..1f37e313f 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdio.h> | 27 | #include <stdio.h> |
28 | #include <string.h> | 28 | #include <string.h> |
29 | #include <stdlib.h> | ||
29 | 30 | ||
30 | #include <netdb.h> | 31 | #include <netdb.h> |
31 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
@@ -169,4 +170,4 @@ int nslookup_main(int argc, char **argv) | |||
169 | return EXIT_SUCCESS; | 170 | return EXIT_SUCCESS; |
170 | } | 171 | } |
171 | 172 | ||
172 | /* $Id: nslookup.c,v 1.18 2001/01/24 18:44:54 andersen Exp $ */ | 173 | /* $Id: nslookup.c,v 1.19 2001/01/27 08:24:37 andersen Exp $ */ |
diff --git a/networking/ping.c b/networking/ping.c index 37ca26f31..a2e916362 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.34 2001/01/24 18:44:54 andersen Exp $ | 3 | * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -47,6 +47,9 @@ | |||
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | #include <errno.h> | 49 | #include <errno.h> |
50 | #include <unistd.h> | ||
51 | #include <string.h> | ||
52 | #include <stdlib.h> | ||
50 | 53 | ||
51 | 54 | ||
52 | /* It turns out that libc5 doesn't have proper icmp support | 55 | /* It turns out that libc5 doesn't have proper icmp support |
diff --git a/networking/wget.c b/networking/wget.c index 2c38cb08e..438ecba2e 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -33,6 +33,18 @@ | |||
33 | #include <arpa/inet.h> | 33 | #include <arpa/inet.h> |
34 | #include <netdb.h> | 34 | #include <netdb.h> |
35 | 35 | ||
36 | /* Stupid libc5 doesn't define this... */ | ||
37 | #ifndef timersub | ||
38 | #define timersub(a, b, result) \ | ||
39 | do { \ | ||
40 | (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ | ||
41 | (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ | ||
42 | if ((result)->tv_usec < 0) { \ | ||
43 | --(result)->tv_sec; \ | ||
44 | (result)->tv_usec += 1000000; \ | ||
45 | } \ | ||
46 | } while (0) | ||
47 | #endif | ||
36 | 48 | ||
37 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); | 49 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); |
38 | FILE *open_socket(char *host, int port); | 50 | FILE *open_socket(char *host, int port); |
@@ -283,7 +295,7 @@ FILE *open_socket(char *host, int port) | |||
283 | int fd; | 295 | int fd; |
284 | FILE *fp; | 296 | FILE *fp; |
285 | 297 | ||
286 | memzero(&sin, sizeof(sin)); | 298 | memset(&sin, 0, sizeof(sin)); |
287 | sin.sin_family = AF_INET; | 299 | sin.sin_family = AF_INET; |
288 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) | 300 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) |
289 | error_msg_and_die("cannot resolve %s\n", host); | 301 | error_msg_and_die("cannot resolve %s\n", host); |
@@ -521,7 +533,7 @@ progressmeter(int flag) | |||
521 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 533 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
522 | * SUCH DAMAGE. | 534 | * SUCH DAMAGE. |
523 | * | 535 | * |
524 | * $Id: wget.c,v 1.22 2001/01/26 02:04:49 andersen Exp $ | 536 | * $Id: wget.c,v 1.23 2001/01/27 08:24:38 andersen Exp $ |
525 | */ | 537 | */ |
526 | 538 | ||
527 | 539 | ||