From 194d3d6894709503d31d6746bfe887143eea9e57 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 11 Aug 2003 20:41:33 +0000 Subject: force connect manually so basics work. 2003-08-11 Not Zed * providers/imapp/camel-imapp-store.c (imap_get_folder_info): force connect manually so basics work. ** See bug #45505. * camel-service.c (camel_gethostbyname): duh, pthread_create returns the error code directly, not via errno. (camel_gethostbyaddr): Same, also properly handle the failure case. 2003-08-01 Not Zed ** See bug #47208. * camel-filter-search.c (match_all): match-all with no arguments should always return TRUE. * camel-folder-search.c (camel_folder_search_execute_expression): print a warning when we get an invalid result type & fixed a leak for that case. svn path=/trunk/; revision=22179 --- camel/camel-service.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'camel/camel-service.c') diff --git a/camel/camel-service.c b/camel/camel-service.c index ae3a36dba4..bc4f4d8764 100644 --- a/camel/camel-service.c +++ b/camel/camel-service.c @@ -750,10 +750,11 @@ camel_gethostbyname (const char *name, CamelException *exout) EMsgPort *reply_port; pthread_t id; fd_set rdset; + int err; reply_port = msg->msg.reply_port = e_msgport_new(); fd = e_msgport_fd(msg->msg.reply_port); - if (pthread_create(&id, NULL, get_hostbyname, msg) == 0) { + if ((err = pthread_create(&id, NULL, get_hostbyname, msg)) == 0) { d(printf("waiting for name return/cancellation in main process\n")); do { FD_ZERO(&rdset); @@ -786,7 +787,7 @@ camel_gethostbyname (const char *name, CamelException *exout) d(printf("child done\n")); } } else { - camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(errno)); + camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(err)); } e_msgport_destroy(reply_port); } @@ -873,10 +874,11 @@ camel_gethostbyaddr (const char *addr, int len, int type, CamelException *exout) EMsgPort *reply_port; pthread_t id; fd_set rdset; - + int err; + reply_port = msg->msg.reply_port = e_msgport_new (); fd = e_msgport_fd (msg->msg.reply_port); - if (pthread_create (&id, NULL, get_hostbyaddr, msg) == 0) { + if ((err = pthread_create (&id, NULL, get_hostbyaddr, msg)) == 0) { d(printf("waiting for name return/cancellation in main process\n")); do { FD_ZERO(&rdset); @@ -908,7 +910,10 @@ camel_gethostbyaddr (const char *addr, int len, int type, CamelException *exout) pthread_join(id, NULL); d(printf("child done\n")); } + } else { + camel_exception_setv(&ex, CAMEL_EXCEPTION_SYSTEM, _("Host lookup failed: cannot create thread: %s"), g_strerror(err)); } + e_msgport_destroy (reply_port); } -- cgit v1.2.3