diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-04-26 15:51:50 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-04-26 15:51:50 +0000 |
commit | 9662ef7a3143d341483baa7cbd1d0117776b3fc6 (patch) | |
tree | 1e3c0c91491a98bae02fcd4f7a3d55df56f1d7db | |
parent | 1d568d7d47c8381c870dd27a6ec4773452793905 (diff) | |
download | drakx-9662ef7a3143d341483baa7cbd1d0117776b3fc6.tar drakx-9662ef7a3143d341483baa7cbd1d0117776b3fc6.tar.gz drakx-9662ef7a3143d341483baa7cbd1d0117776b3fc6.tar.bz2 drakx-9662ef7a3143d341483baa7cbd1d0117776b3fc6.tar.xz drakx-9662ef7a3143d341483baa7cbd1d0117776b3fc6.zip |
enhance logging again, re-indent
-rw-r--r-- | mdk-stage1/dns.c | 17 |
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; } |