Commit a38f86ea authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

410. [bug] lwres_gethostbyname() and company set lwres_h_errno

                        to a random value on success.
parent 7d8d82ce
410. [bug] lwres_gethostbyname() and company set lwres_h_errno
to a random value on success.
409. [bug] If named was shut down early in the startup
process, ns_omapi_shutdown() would attempt to lock
an unintialized mutex. [RT #262]
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: gethost.c,v 1.24 2000/08/14 01:28:21 marka Exp $ */
/* $Id: gethost.c,v 1.25 2000/08/26 01:51:05 gson Exp $ */
#include <config.h>
......@@ -38,37 +38,30 @@ static int copytobuf(struct hostent *, struct hostent *, char *, int);
struct hostent *
lwres_gethostbyname(const char *name) {
int error;
if (he != NULL)
lwres_freehostent(he);
he = lwres_getipnodebyname(name, AF_INET, 0, &error);
lwres_h_errno = error;
he = lwres_getipnodebyname(name, AF_INET, 0, &lwres_h_errno);
return (he);
}
struct hostent *
lwres_gethostbyname2(const char *name, int af) {
int error;
if (he != NULL)
lwres_freehostent(he);
he = lwres_getipnodebyname(name, af, 0, &error);
lwres_h_errno = error;
he = lwres_getipnodebyname(name, af, 0, &lwres_h_errno);
return (he);
}
struct hostent *
lwres_gethostbyaddr(const char *addr, int len, int type) {
int error;
if (he != NULL)
lwres_freehostent(he);
he = lwres_getipnodebyaddr(addr, len, type, &error);
lwres_h_errno = error;
he = lwres_getipnodebyaddr(addr, len, type, &lwres_h_errno);
return (he);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment