aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mx.h3
-rw-r--r--socket.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/mx.h b/mx.h
index 0a28f2b0..cc0e28d5 100644
--- a/mx.h
+++ b/mx.h
@@ -9,6 +9,9 @@ struct mxentry
extern struct mxentry * getmxrecords(const char *);
/* some versions of FreeBSD should declare this but don't */
+/* But only declare it if it isn't already */
+#ifndef h_errno
extern int h_errno;
+#endif /* ndef h_errno */
/* mx.h ends here */
diff --git a/socket.c b/socket.c
index 8f559799..c852e641 100644
--- a/socket.c
+++ b/socket.c
@@ -32,6 +32,9 @@
#include "fetchmail.h"
#include "i18n.h"
+/* We need to define h_errno only if it is not already */
+#ifndef h_errno
+
#ifdef HAVE_RES_SEARCH
/* some versions of FreeBSD should declare this but don't */
extern int h_errno;
@@ -40,6 +43,8 @@ extern int h_errno;
static int h_errno;
#endif
+#endif /* ndef h_errno */
+
#if NET_SECURITY
#include <net/security.h>
#endif /* NET_SECURITY */