From f132c28d7f50f16f0d1fe5c93a68eb17ba6d55ac Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 11 Apr 2001 16:10:30 +0000 Subject: Check if gethostbyname_r take five params 2001-04-11 JP Rosevear * configure.in: Check if gethostbyname_r take five params * acconfig.h: add GETHOSTBYNAME_R_FIVE_ARGS 2001-04-11 JP Rosevear * 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 --- camel/ChangeLog | 19 +++++++++++++++++++ camel/Makefile.am | 1 + camel/camel-service.c | 8 +++++++- camel/providers/imap/Makefile.am | 1 + camel/providers/local/Makefile.am | 1 + camel/providers/pop3/Makefile.am | 1 + camel/providers/sendmail/Makefile.am | 4 +++- camel/providers/smtp/Makefile.am | 1 + 8 files changed, 34 insertions(+), 2 deletions(-) (limited to 'camel') 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 + + * 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 * 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) \ -- cgit v1.2.3