name changes and fix return value in res_init().
authorRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Fri, 29 Mar 1985 01:26:14 +0000 (17:26 -0800)
committerRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Fri, 29 Mar 1985 01:26:14 +0000 (17:26 -0800)
SCCS-vsn: lib/libc/net/SCCS/hosttable/gethostnamadr.c 4.10
SCCS-vsn: lib/libc/net/gethostnamadr.c 4.10
SCCS-vsn: lib/libc/net/res_init.c 4.3
SCCS-vsn: lib/libc/net/res_mkquery.c 4.4
SCCS-vsn: lib/libc/net/res_send.c 4.3

usr/src/lib/libc/net/SCCS/hosttable/gethostnamadr.c
usr/src/lib/libc/net/gethostnamadr.c
usr/src/lib/libc/net/res_init.c
usr/src/lib/libc/net/res_mkquery.c
usr/src/lib/libc/net/res_send.c

index a17d857..9622409 100644 (file)
@@ -1,4 +1,4 @@
-/*     gethostnamadr.c 4.9     85/03/25        */
+/*     gethostnamadr.c 4.10    85/03/28        */
 
 #include <stdio.h>
 #include <netdb.h>
 
 #include <stdio.h>
 #include <netdb.h>
index 1872eca..4697f23 100644 (file)
@@ -1,4 +1,4 @@
-/*     gethostnamadr.c 4.9     85/03/25        */
+/*     gethostnamadr.c 4.10    85/03/28        */
 
 #include <sys/types.h>
 #include <sys/socket.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -26,10 +26,10 @@ getanswer(msg, msglen, iquery)
        char *eom, *bp, **ap;
        int type, class, ancount, buflen;
 
        char *eom, *bp, **ap;
        int type, class, ancount, buflen;
 
-       n = sendquery(msg, msglen, answer, sizeof(answer));
+       n = res_send(msg, msglen, answer, sizeof(answer));
        if (n < 0) {
                if (_res.options & RES_DEBUG)
        if (n < 0) {
                if (_res.options & RES_DEBUG)
-                       printf("sendquery failed\n");
+                       printf("res_send failed\n");
                return (NULL);
        }
        eom = answer + n;
                return (NULL);
        }
        eom = answer + n;
@@ -110,10 +110,11 @@ gethostbyname(name)
 {
        int n;
 
 {
        int n;
 
-       n = mkquery(QUERY, name, C_ANY, T_A, NULL, 0, NULL, hostbuf, sizeof(hostbuf));
+       n = res_mkquery(QUERY, name, C_ANY, T_A, NULL, 0, NULL,
+               hostbuf, sizeof(hostbuf));
        if (n < 0) {
                if (_res.options & RES_DEBUG)
        if (n < 0) {
                if (_res.options & RES_DEBUG)
-                       printf("mkquery failed\n");
+                       printf("res_mkquery failed\n");
                return (NULL);
        }
        return (getanswer(hostbuf, n, 0));
                return (NULL);
        }
        return (getanswer(hostbuf, n, 0));
@@ -128,10 +129,11 @@ gethostbyaddr(addr, len, type)
 
        if (type != AF_INET)
                return (NULL);
 
        if (type != AF_INET)
                return (NULL);
-       n = mkquery(IQUERY, NULL, C_IN, T_A, addr, len, NULL, hostbuf, sizeof(hostbuf));
+       n = res_mkquery(IQUERY, NULL, C_IN, T_A, addr, len, NULL,
+               hostbuf, sizeof(hostbuf));
        if (n < 0) {
                if (_res.options & RES_DEBUG)
        if (n < 0) {
                if (_res.options & RES_DEBUG)
-                       printf("mkquery failed\n");
+                       printf("res_mkquery failed\n");
                return (NULL);
        }
        return (getanswer(hostbuf, n, 1));
                return (NULL);
        }
        return (getanswer(hostbuf, n, 1));
index 2832e62..b489e77 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)res_init.c 4.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_init.c 4.3 (Berkeley) %G%";
 #endif
 
 #include <sys/types.h>
 #endif
 
 #include <sys/types.h>
@@ -49,6 +49,4 @@ res_init()
        /* Allow user to override the local domain definition */
        if ((cp = getenv("LOCALDOMAIN")) != NULL)
                strncpy(_res.defdname, cp, sizeof(_res.defdname));
        /* Allow user to override the local domain definition */
        if ((cp = getenv("LOCALDOMAIN")) != NULL)
                strncpy(_res.defdname, cp, sizeof(_res.defdname));
-
-       return (0);
 }
 }
index 7937591..1a845cf 100644 (file)
@@ -1,4 +1,4 @@
-/*     res_mkquery.c   4.3     85/03/27        */
+/*     res_mkquery.c   4.4     85/03/28        */
 
 #include <stdio.h>
 #include <sys/types.h>
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -10,7 +10,7 @@
  * Form all types of queries.
  * Returns the size of the result or -1.
  */
  * Form all types of queries.
  * Returns the size of the result or -1.
  */
-mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
+res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
        int op;                 /* opcode of query */
        char *dname;            /* domain name */
        int class, type;        /* class and type of query */
        int op;                 /* opcode of query */
        char *dname;            /* domain name */
        int class, type;        /* class and type of query */
@@ -28,7 +28,7 @@ mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
        extern char *index();
 
        if (_res.options & RES_DEBUG)
        extern char *index();
 
        if (_res.options & RES_DEBUG)
-               printf("mkquery(%d, %s, %d, %d)\n", op, dname, class, type);
+               printf("res_mkquery(%d, %s, %d, %d)\n", op, dname, class, type);
        /*
         * Initialize header fields.
         */
        /*
         * Initialize header fields.
         */
index 2dcdea5..2d9fb40 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)res_send.c 4.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_send.c 4.3 (Berkeley) %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -17,7 +17,7 @@ static char sccsid[] = "@(#)res_send.c        4.2 (Berkeley) %G%";
 
 extern int errno;
 
 
 extern int errno;
 
-sendquery(buf, buflen, answer, anslen)
+res_send(buf, buflen, answer, anslen)
        char *buf;
        int buflen;
        char *answer;
        char *buf;
        int buflen;
        char *answer;
@@ -33,13 +33,11 @@ sendquery(buf, buflen, answer, anslen)
        HEADER *anhp = (HEADER *) answer;
 
        if (_res.options & RES_DEBUG) {
        HEADER *anhp = (HEADER *) answer;
 
        if (_res.options & RES_DEBUG) {
-               printf("sendquery()\n");
+               printf("res_send()\n");
                p_query(buf);
        }
                p_query(buf);
        }
-       if (!(_res.options & RES_INIT)) {
-               if (!res_init())
-                       return (-1);
-       }
+       if (!(_res.options & RES_INIT))
+               res_init();
        s = -1;
        v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
        id = hp->id;
        s = -1;
        v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
        id = hp->id;