aboutsummaryrefslogtreecommitdiff
path: root/resolv/getnetnamadr.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-07-26 10:14:02 +0000
committerRoland McGrath <roland@gnu.org>1995-07-26 10:14:02 +0000
commit3d61b63cc722951e3a5261e6bc3f0488eb35d441 (patch)
tree19195b08df7f3f992f0d539205df60ff690cd0f6 /resolv/getnetnamadr.c
parent958f803fc021993cc2ee1d4157d0092b830368aa (diff)
downloadglibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.zip
glibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.tar.gz
glibc-3d61b63cc722951e3a5261e6bc3f0488eb35d441.tar.bz2
* asia, backward, europe, leapseconds, southamerica: New data from
ADO's 95e. * inet/Makefile (routines): Removed inet_addr. * inet/inet_addr.c: Moved to resolv/ subdirectory. * resolv/Makefile (routines): Added inet_addr. * resolv/inet_addr.c: Incorporated from BIND 4.9.3-BETA24 release. * resolv/gethnamaddr.c: Likewise. * resolv/getnetbyaddr.c: Likewise. * resolv/getnetbyname.c: Likewise. * resolv/getnetent.c: Likewise. * resolv/getnetnamadr.c: Likewise. * resolv/herror.c: Likewise. * resolv/nsap_addr.c: Likewise. * resolv/res_comp.c: Likewise. * resolv/res_debug.c: Likewise. * resolv/res_init.c: Likewise. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_send.c: Likewise. * resolv/resolv.h: Likewise. * resolv/sethostent.c: Likewise. * resolv/arpa/nameser.h: Likewise. * inet/netdb.h: Incorporated from BIND 4.9.3-BETA24 release. [__GNU_LIBRARY__]: Include <rpc/netdb.h> instead of repeating its declarations (and doing so only #ifdef sun!). * posix/sys/types.h [__USE_BSD] (__BIT_TYPES_DEFINED__): New macro. [__USE_BSD] [__GNUC__] (int64_t, u_int64_t, register_t): New typedefs.
Diffstat (limited to 'resolv/getnetnamadr.c')
-rw-r--r--resolv/getnetnamadr.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/resolv/getnetnamadr.c b/resolv/getnetnamadr.c
index 19a31af..e5cc505 100644
--- a/resolv/getnetnamadr.c
+++ b/resolv/getnetnamadr.c
@@ -56,7 +56,6 @@ static char rcsid[] = "$Id$";
#include <ctype.h>
#include <errno.h>
#include <string.h>
-#include "conf/portability.h"
extern int h_errno;
@@ -65,11 +64,7 @@ extern int errno;
#endif
struct netent *_getnetbyaddr __P((long net, int type));
-#if defined(sun)
-struct netent *_getnetbyname __P((char *name));
-#else
struct netent *_getnetbyname __P((const char *name));
-#endif
#define BYADDR 0
#define BYNAME 1
@@ -102,8 +97,7 @@ getnetanswer(answer, anslen, net_i)
register u_char *cp;
register int n;
u_char *eom;
- int type, class, buflen, ancount, qdcount, haveanswer, i, nchar,
- getclass = C_ANY, net_length = 0;
+ int type, class, buflen, ancount, qdcount, haveanswer, i, nchar;
char aux1[30], aux2[30], ans[30], *in, *st, *pauxt, *bp, **ap,
*paux1 = &aux1[0], *paux2 = &aux2[0], flag = 0;
static struct netent net_entry;
@@ -264,19 +258,18 @@ getnetbyaddr(net, net_type)
struct netent *
getnetbyname(net)
-#if defined(sun)
- register char *net;
-#else
register const char *net;
-#endif
{
- unsigned int netbr[4];
int anslen;
querybuf buf;
char qbuf[MAXDNAME];
struct netent *net_entry;
- strcpy(&qbuf[0],net);
+ if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
+ h_errno = NETDB_INTERNAL;
+ return (NULL);
+ }
+ strcpy(&qbuf[0], net);
anslen = res_search(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof(buf));
if (anslen < 0) {
#ifdef DEBUG