]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Return record count as well as result code.
authorTed Lemon <source@isc.org>
Thu, 6 Jul 2000 06:22:36 +0000 (06:22 +0000)
committerTed Lemon <source@isc.org>
Thu, 6 Jul 2000 06:22:36 +0000 (06:22 +0000)
minires/res_findzonecut.c

index f17be86c6a3e17281a1ed24dc42e6a2c872da356..08be2cfcda53b2f16e27c627814d9b180f265e02 100644 (file)
@@ -1,5 +1,5 @@
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_findzonecut.c,v 1.6 2000/07/05 07:28:46 mellon Exp $";
+static const char rcsid[] = "$Id: res_findzonecut.c,v 1.7 2000/07/06 06:22:36 mellon Exp $";
 #endif /* not lint */
 
 /*
@@ -136,15 +136,14 @@ static ns_rcode   do_query(res_state, const char *, ns_class, ns_type,
 ns_rcode
 res_findzonecut(res_state statp, const char *dname, ns_class class, int opts,
                char *zname, size_t zsize, struct in_addr *addrs, int naddrs,
-               void *zcookie)
+               int *count, void *zcookie)
 {
        char mname[NS_MAXDNAME];
        u_long save_pfcode;
        rrset_ns nsrrs;
-       int n;
+       int n = 0;
        ns_rcode rcode;
 
-
        DPRINTF(("START dname='%s' class=%s, zsize=%ld, naddrs=%d",
                 dname, p_class(class), (long)zsize, naddrs));
        save_pfcode = statp->pfcode;
@@ -179,6 +178,8 @@ res_findzonecut(res_state statp, const char *dname, ns_class class, int opts,
        DPRINTF(("FINISH n=%d (%s)", n, (n < 0) ? strerror(errno) : "OK"));
        free_nsrrset(&nsrrs);
        statp->pfcode = save_pfcode;
+       if (count)
+               *count = n;
        return rcode;
 }