]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/names-net.c
lspci: Decode Precision Time Measurement capabiltity
[pciutils.git] / lib / names-net.c
index d14949115f35c62c4c24f6c3ad0a96d066f6866d..dfac7850dfbcff9b10f421d091d62b94268e8dd1 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 
 #include "internal.h"
 #include "names.h"
@@ -17,6 +18,7 @@
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>
+#include <netdb.h>
 
 /*
  * Unfortunately, there are no portable functions for DNS RR parsing,
@@ -74,7 +76,8 @@ static int
 dns_parse_packet(struct dns_state *s, byte *p, unsigned int plen)
 {
   byte *end = p + plen;
-  unsigned int i, j, x, len;
+  unsigned int i, j, len;
+  unsigned int UNUSED x;
 
 #if 0
   /* Dump the packet */
@@ -196,7 +199,7 @@ char
   res = res_query(dnsname, ns_c_in, ns_t_txt, answer, sizeof(answer));
   if (res < 0)
     {
-      a->debug("\tfailed, h_errno=%d\n", _res.res_h_errno);
+      a->debug("\tfailed, h_errno=%d\n", h_errno);
       return NULL;
     }
   if (dns_parse_packet(&ds, answer, res) < 0)