aboutsummaryrefslogtreecommitdiff
path: root/util-linux/rdate.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-10-31 09:31:46 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-10-31 09:31:46 +0000
commitf9ece60e489d3250dac2887a0f0b6ba62b8a158c (patch)
treebacb9f48301189de134d9f8edc2f1f45c65086c5 /util-linux/rdate.c
parentab8f96331f5f70a30edc2e6232b8ae668b4bac8a (diff)
downloadbusybox-w32-f9ece60e489d3250dac2887a0f0b6ba62b8a158c.tar.gz
busybox-w32-f9ece60e489d3250dac2887a0f0b6ba62b8a158c.tar.bz2
busybox-w32-f9ece60e489d3250dac2887a0f0b6ba62b8a158c.zip
Rework wget, the xconnect interface, and its various clients
in order to fix the problems with round robin DNS reported by Andrew Flegg: http://busybox.net/lists/busybox/2003-October/009579.html This removes the ipv6 specific xconnect dns lookups. I do not see why that would need to be special cased for ipv6 as was done, but that will just have to be tested. So IPV6 people -- please test this change! -Erik git-svn-id: svn://busybox.net/trunk/busybox@7735 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--util-linux/rdate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 8d156cc78..a822f42ff 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -47,17 +47,16 @@ static void socket_timeout(int sig)
47static time_t askremotedate(const char *host) 47static time_t askremotedate(const char *host)
48{ 48{
49 unsigned long int nett, localt; 49 unsigned long int nett, localt;
50 const char *port="37"; 50 struct sockaddr_in addr s_in;
51 int fd; 51 int fd;
52 52
53 if (getservbyname("time", "tcp") != NULL) 53 bb_lookup_host(&s_in, host, "time");
54 port="time";
55 54
56 /* Add a timeout for dead or non accessable servers */ 55 /* Add a timeout for dead or non accessable servers */
57 alarm(10); 56 alarm(10);
58 signal(SIGALRM, socket_timeout); 57 signal(SIGALRM, socket_timeout);
59 58
60 fd = xconnect(host, port); 59 fd = xconnect(s_in);
61 60
62 if (safe_read(fd, (void *)&nett, 4) != 4) /* read time from server */ 61 if (safe_read(fd, (void *)&nett, 4) != 4) /* read time from server */
63 bb_error_msg_and_die("%s did not send the complete time", host); 62 bb_error_msg_and_die("%s did not send the complete time", host);