summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-04-26 15:51:50 +0000
committerOlivier Blin <oblin@mandriva.org>2005-04-26 15:51:50 +0000
commit9662ef7a3143d341483baa7cbd1d0117776b3fc6 (patch)
tree1e3c0c91491a98bae02fcd4f7a3d55df56f1d7db
parent1d568d7d47c8381c870dd27a6ec4773452793905 (diff)
downloaddrakx-backup-do-not-use-9662ef7a3143d341483baa7cbd1d0117776b3fc6.tar
drakx-backup-do-not-use-9662ef7a3143d341483baa7cbd1d0117776b3fc6.tar.gz
drakx-backup-do-not-use-9662ef7a3143d341483baa7cbd1d0117776b3fc6.tar.bz2
drakx-backup-do-not-use-9662ef7a3143d341483baa7cbd1d0117776b3fc6.tar.xz
drakx-backup-do-not-use-9662ef7a3143d341483baa7cbd1d0117776b3fc6.zip
enhance logging again, re-indent
-rw-r--r--mdk-stage1/dns.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/mdk-stage1/dns.c b/mdk-stage1/dns.c
index 47049302b..7a386fad1 100644
--- a/mdk-stage1/dns.c
+++ b/mdk-stage1/dns.c
@@ -40,27 +40,26 @@ int mygethostbyname(char * name, struct in_addr * addr)
{
struct hostent * h;
- /* prevent from timeouts */
- if (dns_server.s_addr == 0)
- return -1;
+ /* prevent from timeouts */
+ if (dns_server.s_addr == 0)
+ return -1;
+
+ h = gethostbyname(name);
- h = gethostbyname(name);
if (!h && domain) {
// gethostbyname from dietlibc doesn't support domain handling
char fully_qualified[500];
sprintf(fully_qualified, "%s.%s", name, domain);
h = gethostbyname(fully_qualified);
}
- if (!h) {
- log_message("unknown host %s", name);
- return -1;
- }
- if (h->h_addr_list && (h->h_addr_list)[0]) {
+ if (h && h->h_addr_list && (h->h_addr_list)[0]) {
memcpy(addr, (h->h_addr_list)[0], sizeof(*addr));
log_message("is-at: %s", inet_ntoa(*addr));
return 0;
}
+
+ log_message("unknown host %s", name);
return -1;
}