From ffccf6eb5de311a3db8c3d7f7496e2f0cad69a23 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Sat, 20 Dec 2003 01:47:18 +0000 Subject: Change interface to bb_lookup_host, dont try and set port inside this function as there is no gracefull way of handling failures. Rename bb_getport to bb_lookup_port, allow a default port to be specified so it always returns a correct value. Modify ftpgetput/rdate/wget to use the new interface. wget/rdate now use etc/services with a falback default value. --- util-linux/rdate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util-linux/rdate.c') diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 0b5f8e460..a317cda55 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c @@ -50,7 +50,8 @@ static time_t askremotedate(const char *host) struct sockaddr_in s_in; int fd; - bb_lookup_host(&s_in, host, "time"); + bb_lookup_host(&s_in, host); + s_in.sin_port = bb_lookup_port("time", 37); /* Add a timeout for dead or non accessable servers */ alarm(10); -- cgit v1.2.3