diff options
author | Chris Lumens <clumens@redhat.com> | 2008-02-05 10:06:07 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-02-05 21:58:38 -0500 |
commit | eca30cc3ced2bef4164e577cc5b5865f70899c8a (patch) | |
tree | 14f2afc16a83149690b82fc71af867b6a0961528 /isys/nfsmount.c | |
parent | ff1c377b3798f0bbb6730fd179a8d4ea6711c23f (diff) | |
download | anaconda-eca30cc3ced2bef4164e577cc5b5865f70899c8a.tar.gz anaconda-eca30cc3ced2bef4164e577cc5b5865f70899c8a.tar.xz anaconda-eca30cc3ced2bef4164e577cc5b5865f70899c8a.zip |
Remove our own DNS functions, since glibc's are available now.
Diffstat (limited to 'isys/nfsmount.c')
-rw-r--r-- | isys/nfsmount.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/isys/nfsmount.c b/isys/nfsmount.c index 21ad20d7c..55ba33678 100644 --- a/isys/nfsmount.c +++ b/isys/nfsmount.c @@ -59,8 +59,6 @@ #include "nfs_mount4.h" #undef NFS_NEED_KERNEL_TYPES -#include "dns.h" - static char *nfs_strerror(int stat); #define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r)) @@ -310,11 +308,13 @@ int nfsmount(const char *spec, const char *node, int *flags, if (!inet_aton(hostname, &server_addr.sin_addr)) #endif { - if (mygethostbyname(hostname, &server_addr.sin_addr, AF_INET)) { + struct hostent *he = gethostbyname(hostname); + if (he) { + memcpy(&server_addr.sin_addr, he->h_addr_list[0], he->h_length); + server_addr.sin_family = he->h_addrtype; + } else { myerror = ERROR_HOSTNAME; goto fail; - } else { - server_addr.sin_family = AF_INET; } } @@ -548,12 +548,14 @@ int nfsmount(const char *spec, const char *node, int *flags, mount_server_addr.sin_family = AF_INET; mount_server_addr.sin_addr.s_addr = inet_addr(hostname); } else { - if (mygethostbyname(hostname, &mount_server_addr.sin_addr, AF_INET)) { - myerror = ERROR_HOSTNAME; - goto fail; - } else { - mount_server_addr.sin_family = AF_INET; - } + struct hostent *he = gethostbyname(hostname); + if (he) { + memcpy(&server_addr.sin_addr, he->h_addr_list[0], he->h_length); + server_addr.sin_family = he->h_addrtype; + } else { + myerror = ERROR_HOSTNAME; + goto fail; + } } } |