aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-04-12 00:10:30 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-04-12 00:10:30 +0800
commitf132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac (patch)
tree9a2a78d068638605353988662cad84b7828ef37d
parent028643bccfc06f2e070c7bf5b7ee582c26c5d650 (diff)
downloadgsoc2013-evolution-f132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac.tar
gsoc2013-evolution-f132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac.tar.gz
gsoc2013-evolution-f132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac.tar.bz2
gsoc2013-evolution-f132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac.tar.lz
gsoc2013-evolution-f132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac.tar.xz
gsoc2013-evolution-f132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac.tar.zst
gsoc2013-evolution-f132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac.zip
Check if gethostbyname_r take five params
2001-04-11 JP Rosevear <jpr@ximian.com> * configure.in: Check if gethostbyname_r take five params * acconfig.h: add GETHOSTBYNAME_R_FIVE_ARGS 2001-04-11 JP Rosevear <jpr@ximian.com> * providers/imap/Makefile.am: user GNOME_INCLUDEDIR since gnome files are included in the top level camel headers and the gtk include dir is now versioned and such * providers/local/Makefile.am: ditto * providers/pop3/Makefile.am: ditto * providers/smtp/Makefile.am: ditto * providers/sendmail/Makefile.am: ditto * camel-service.c: use five arg version of gethostbyname_r if appropriate (camel_get_host_byname): check if msg->herr is non-zero instead of checking if msg->hp is null since we may not always have msg->hp svn path=/trunk/; revision=9239
-rw-r--r--ChangeLog6
-rw-r--r--acconfig.h3
-rw-r--r--camel/ChangeLog19
-rw-r--r--camel/Makefile.am1
-rw-r--r--camel/camel-service.c8
-rw-r--r--camel/providers/imap/Makefile.am1
-rw-r--r--camel/providers/local/Makefile.am1
-rw-r--r--camel/providers/pop3/Makefile.am1
-rw-r--r--camel/providers/sendmail/Makefile.am4
-rw-r--r--camel/providers/smtp/Makefile.am1
-rw-r--r--configure.in32
11 files changed, 75 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c11055007..1e4f63e61d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-04-11 JP Rosevear <jpr@ximian.com>
+
+ * configure.in: Check if gethostbyname_r take five params
+
+ * acconfig.h: add GETHOSTBYNAME_R_FIVE_ARGS
+
2001-04-10 Gediminas Paulauskas <menesis@delfi.lt>
* AUTHORS: /me is a translator.
diff --git a/acconfig.h b/acconfig.h
index 763e90d95a..1bb33c8042 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -27,3 +27,6 @@
/* Define if ctime_r takes three arguments */
#undef CTIME_R_THREE_ARGS
+
+/* Define if gethostbyname_r takes five arguments */
+#undef GETHOSTBYNAME_R_FIVE_ARGS
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 99abe595ea..e5a8fac27b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,22 @@
+2001-04-11 JP Rosevear <jpr@ximian.com>
+
+ * providers/imap/Makefile.am: user GNOME_INCLUDEDIR since gnome
+ files are included in the top level camel headers and the gtk
+ include dir is now versioned and such
+
+ * providers/local/Makefile.am: ditto
+
+ * providers/pop3/Makefile.am: ditto
+
+ * providers/smtp/Makefile.am: ditto
+
+ * providers/sendmail/Makefile.am: ditto
+
+ * camel-service.c: use five arg version of gethostbyname_r if
+ appropriate
+ (camel_get_host_byname): check if msg->herr is non-zero instead of
+ checking if msg->hp is null since we may not always have msg->hp
+
2001-04-11 Jeffrey Stedfast <fejj@ximian.com>
* camel-sasl-digest-md5.c (digest_response): Use
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 96a1748fc0..4ccc5a62d0 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -10,6 +10,7 @@ lib_LTLIBRARIES = libcamel.la
INCLUDES = -I.. -I$(srcdir)/.. \
-I$(top_srcdir)/intl \
-I$(top_srcdir)/e-util \
+ $(GNOME_INCLUDEDIR) \
$(GLIB_CFLAGS) \
$(GNOME_XML_CFLAGS) \
$(UNICODE_CFLAGS) \
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 1380cca4bb..8c37b0e79d 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -504,7 +504,9 @@ struct _lookup_msg {
int result;
int herr;
struct hostent hostbuf;
+#ifndef GETHOSTBYNAME_R_FIVE_ARGS
struct hostent *hp;
+#endif
int hostbuflen;
char *hostbufmem;
};
@@ -514,7 +516,11 @@ get_host(void *data)
{
struct _lookup_msg *info = data;
+#ifdef GETHOSTBYNAME_R_FIVE_ARGS
+ while (gethostbyname_r(info->name, &info->hostbuf, info->hostbufmem, info->hostbuflen, &info->herr) && info->herr == ERANGE) {
+#else
while ((info->result = gethostbyname_r(info->name, &info->hostbuf, info->hostbufmem, info->hostbuflen, &info->hp, &info->herr)) == ERANGE) {
+#endif
d(printf("gethostbyname fialed?\n"));
#ifdef ENABLE_THREADS
pthread_testcancel();
@@ -594,7 +600,7 @@ struct hostent *camel_get_host_byname(const char *name, CamelException *ex)
camel_operation_end(NULL);
- if (msg->hp == NULL) {
+ if (msg->herr) {
if (!camel_exception_is_set(ex)) {
if (msg->herr == HOST_NOT_FOUND || msg->herr == NO_DATA)
camel_exception_setv(ex, 1, _("Host lookup failed: %s: host not found"), name);
diff --git a/camel/providers/imap/Makefile.am b/camel/providers/imap/Makefile.am
index d29a1677af..545c404174 100644
--- a/camel/providers/imap/Makefile.am
+++ b/camel/providers/imap/Makefile.am
@@ -16,6 +16,7 @@ INCLUDES = -I.. \
-I$(top_srcdir)/e-util \
-I$(top_srcdir) \
-I$(includedir) \
+ $(GNOME_INCLUDEDIR) \
$(GTK_INCLUDEDIR) \
-DG_LOG_DOMAIN=\"camel-imap-provider\"
diff --git a/camel/providers/local/Makefile.am b/camel/providers/local/Makefile.am
index 2e95021334..9130f62f81 100644
--- a/camel/providers/local/Makefile.am
+++ b/camel/providers/local/Makefile.am
@@ -15,6 +15,7 @@ INCLUDES = -I.. \
-I$(top_srcdir)/e-util \
-I$(top_srcdir) \
-I$(includedir) \
+ $(GNOME_INCLUDEDIR) \
$(GTK_INCLUDEDIR) \
-DG_LOG_DOMAIN=\"camel-local-provider\"
diff --git a/camel/providers/pop3/Makefile.am b/camel/providers/pop3/Makefile.am
index 608e640cd9..57fb938d89 100644
--- a/camel/providers/pop3/Makefile.am
+++ b/camel/providers/pop3/Makefile.am
@@ -15,6 +15,7 @@ INCLUDES = \
-I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
-I$(top_srcdir)/e-util \
+ $(GNOME_INCLUDEDIR) \
$(KRB4_CFLAGS) \
$(GTK_INCLUDEDIR) \
-DG_LOG_DOMAIN=\"camel-pop3-provider\"
diff --git a/camel/providers/sendmail/Makefile.am b/camel/providers/sendmail/Makefile.am
index 965f56afb8..deec529871 100644
--- a/camel/providers/sendmail/Makefile.am
+++ b/camel/providers/sendmail/Makefile.am
@@ -14,7 +14,9 @@ INCLUDES = \
-I$(srcdir)/../../.. \
-I$(includedir) \
-I$(top_srcdir)/intl \
- $(GTK_INCLUDEDIR) -I$(top_srcdir)/camel \
+ -I$(top_srcdir)/camel \
+ $(GNOME_INCLUDEDIR) \
+ $(GTK_INCLUDEDIR) \
-DG_LOG_DOMAIN=\"camel-sendmail-provider\"
libcamelsendmail_la_SOURCES = \
diff --git a/camel/providers/smtp/Makefile.am b/camel/providers/smtp/Makefile.am
index ca683eeb5f..45e1d77f8c 100644
--- a/camel/providers/smtp/Makefile.am
+++ b/camel/providers/smtp/Makefile.am
@@ -15,6 +15,7 @@ INCLUDES = \
-I$(top_srcdir)/intl \
-I$(top_srcdir)/camel \
-I$(top_srcdir)/e-util \
+ $(GNOME_INCLUDEDIR) \
$(GTK_INCLUDEDIR) \
$(NSPR_CFLAGS) \
$(NSS_CFLAGS) \
diff --git a/configure.in b/configure.in
index c861ef90c7..b94f36e309 100644
--- a/configure.in
+++ b/configure.in
@@ -151,6 +151,38 @@ if test x"$ac_cv_ctime_r_three_args" = xyes ; then
fi
dnl **************************************************
+dnl gethostbyname_r prototype
+dnl **************************************************
+
+AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_five_args,
+[
+ AC_TRY_COMPILE([
+ #include "confdefs.h"
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+
+ #define BUFSIZE (sizeof(struct hostent)+10)
+ ],[
+ struct hostent hent;
+ char buffer[BUFSIZE];
+ int bufsize=BUFSIZE;
+ int h_errno;
+
+ (void)gethostbyname_r( "www.ximian.com", &hent, buffer, bufsize, &h_errno);
+ ],[
+ ac_cv_gethostbyname_r_five_args=yes
+ ],[
+ ac_cv_gethostbyname_r_five_args=no
+ ])
+])
+
+if test x"$ac_cv_gethostbyname_r_five_args" = xyes ; then
+ AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS)
+fi
+
+dnl **************************************************
dnl * pas-backend-file stuff.
dnl * check for db_185.h. if it's there, we use it.
dnl * otherwise, we use db.h (since it'll be 185).