+2001-04-26 Dan Winship <danw@ximian.com>
+
+ * camel-service.c (get_host): Use e_gethostbyname_r.
+ (camel_service_gethost): Remove unused var.
+
2001-04-26 Not Zed <NotZed@Ximian.com>
* Applied jacob's patches for e-poolv stuff.
#include "e-util/e-msgport.h"
#endif
+#include "e-util/e-host-utils.h"
+
#include "camel-service.h"
#include "camel-session.h"
#include "camel-exception.h"
camel_service_gethost (CamelService *service, CamelException *ex)
{
char *hostname;
- struct hostent *h;
if (service->url->host)
hostname = service->url->host;
int result;
int herr;
struct hostent hostbuf;
-#ifndef GETHOSTBYNAME_R_FIVE_ARGS
- struct hostent *hp;
-#endif
int hostbuflen;
char *hostbufmem;
};
{
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
+ while ((info->result = e_gethostbyname_r(info->name, &info->hostbuf, info->hostbufmem, info->hostbuflen, &info->herr)) == ERANGE) {
d(printf("gethostbyname fialed?\n"));
#ifdef ENABLE_THREADS
pthread_testcancel();