]> andersk Git - openssh.git/blobdiff - openbsd-compat/getrrsetbyname.c
- (tim) [configure.ac] Some platforms need sys/types.h for arpa/nameser.h.
[openssh.git] / openbsd-compat / getrrsetbyname.c
index 66d18142e0de63aa423d2b5731adfad606f07879..2016ffe312f37adfcf3fa58e81138ccfdc8256fa 100644 (file)
 
 #define ANSWER_BUFFER_SIZE 1024*64
 
+#if defined(HAVE_DECL_H_ERRNO) && !HAVE_DECL_H_ERRNO
+extern int h_errno;
+#endif
+
 struct dns_query {
        char                    *name;
        u_int16_t               type;
@@ -140,6 +144,8 @@ _getshort(msgp)
        GETSHORT(u, msgp);
        return (u);
 }
+#elif defined(HAVE_DECL__GETSHORT) && (HAVE_DECL__GETSHORT == 0)
+u_int16_t _getshort(register const u_char *);
 #endif
 
 #ifndef HAVE__GETLONG
@@ -152,6 +158,8 @@ _getlong(msgp)
        GETLONG(u, msgp);
        return (u);
 }
+#elif defined(HAVE_DECL__GETLONG) && (HAVE_DECL__GETLONG == 0)
+u_int32_t _getlong(register const u_char *);
 #endif
 
 int
@@ -273,7 +281,7 @@ getrrsetbyname(const char *hostname, unsigned int rdclass,
 
        /* allocate memory for signatures */
        rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));
-       if (rrset->rri_sigs == NULL) {
+       if (rrset->rri_nsigs > 0 && rrset->rri_sigs == NULL) {
                result = ERRSET_NOMEMORY;
                goto fail;
        }
This page took 0.066888 seconds and 4 git commands to generate.