summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-04-26 15:07:26 +0000
committerOlivier Blin <oblin@mandriva.org>2005-04-26 15:07:26 +0000
commit26007ff349359860d465e9bc02b3d4f0bf231ca0 (patch)
tree1dee9487cd7f02c35db50919f9eb789ee8b07a9b
parente5f088cf2c78612a98b1205beddf149103481c29 (diff)
downloaddrakx-26007ff349359860d465e9bc02b3d4f0bf231ca0.tar
drakx-26007ff349359860d465e9bc02b3d4f0bf231ca0.tar.gz
drakx-26007ff349359860d465e9bc02b3d4f0bf231ca0.tar.bz2
drakx-26007ff349359860d465e9bc02b3d4f0bf231ca0.tar.xz
drakx-26007ff349359860d465e9bc02b3d4f0bf231ca0.zip
enhance logging
-rw-r--r--mdk-stage1/dns.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/mdk-stage1/dns.c b/mdk-stage1/dns.c
index e7e045b97..e323817b6 100644
--- a/mdk-stage1/dns.c
+++ b/mdk-stage1/dns.c
@@ -45,20 +45,17 @@ int mygethostbyname(char * name, struct in_addr * addr)
return -1;
h = gethostbyname(name);
+ if (!h && ddomain) {
+ // 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) {
- if (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;
- }
- } else
- return -1;
+ log_message("unknown host %s", name);
+ return -1;
}
-
+
if (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));