aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/hostname.c3
-rw-r--r--networking/nslookup.c3
-rw-r--r--networking/ping.c5
-rw-r--r--networking/wget.c16
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 @@
/* vi: set sw=4 ts=4: */
/*
- * $Id: hostname.c,v 1.20 2001/01/24 18:44:54 andersen Exp $
+ * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $
* Mini hostname implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -28,6 +28,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
+#include <string.h>
#include <stdio.h>
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 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include <netdb.h>
#include <sys/socket.h>
@@ -169,4 +170,4 @@ int nslookup_main(int argc, char **argv)
return EXIT_SUCCESS;
}
-/* $Id: nslookup.c,v 1.18 2001/01/24 18:44:54 andersen Exp $ */
+/* $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 @@
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.34 2001/01/24 18:44:54 andersen Exp $
+ * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -47,6 +47,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
/* 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 @@
#include <arpa/inet.h>
#include <netdb.h>
+/* Stupid libc5 doesn't define this... */
+#ifndef timersub
+#define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif
void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path);
FILE *open_socket(char *host, int port);
@@ -283,7 +295,7 @@ FILE *open_socket(char *host, int port)
int fd;
FILE *fp;
- memzero(&sin, sizeof(sin));
+ memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
if ((hp = (struct hostent *) gethostbyname(host)) == NULL)
error_msg_and_die("cannot resolve %s\n", host);
@@ -521,7 +533,7 @@ progressmeter(int flag)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wget.c,v 1.22 2001/01/26 02:04:49 andersen Exp $
+ * $Id: wget.c,v 1.23 2001/01/27 08:24:38 andersen Exp $
*/