[evolution-patches] Bug in libsoup 2.2.3 on Solaris



> The DNS code for Solaris in libsoup 2.2.3 is broken. The tests/dns
> program failed consistently. The attached patch fixes the problem.
> 
> Hopefully this patch (or something like it) can be merged in to the next
> release of libsoup.

I sent this message to the Soup list, but it doesn't seem very active so
I thought I best send it over here to.

Tim.

-- 
Tim Bishop
http://www.bishnet.net/tim/
PGP Key: 0x5AE7D984

diff -Nru tmp/libsoup-2.2.3/libsoup/soup-dns.c work/libsoup-2.2.3/libsoup/soup-dns.c
--- tmp/libsoup-2.2.3/libsoup/soup-dns.c	2004-08-26 16:33:33.000000000 +0100
+++ work/libsoup-2.2.3/libsoup/soup-dns.c	2005-06-13 19:08:40.241766000 +0100
@@ -199,7 +199,8 @@
 #elif defined(HAVE_GETHOSTBYNAME_R_SOLARIS)
 	{
 		size_t len;
-		int herr, res;
+		int herr;
+		struct hostent *res;
 
 		len = 1024;
 		buf = g_new (char, len);
@@ -208,12 +209,12 @@
 					       &result_buf,
 					       buf,
 					       len,
-					       &herr)) == ERANGE) {
+					       &herr)) == NULL && errno == ERANGE) {
 			len *= 2;
 			buf = g_renew (char, buf, len);
 		}
 
-		if (res)
+		if (res == NULL)
 			result = NULL;
 	}
 #elif defined(HAVE_GETHOSTBYNAME_R_HPUX)
@@ -286,7 +287,8 @@
 #elif defined(HAVE_GETHOSTBYNAME_R_SOLARIS)
 	{
 		size_t len;
-		int herr, res;
+		int herr;
+		struct hostent *res;
 
 		len = 1024;
 		buf = g_new (char, len);
@@ -297,12 +299,12 @@
 					       &result_buf,
 					       buf,
 					       len,
-					       &herr)) == ERANGE) {
+					       &herr)) == NULL && errno == ERANGE) {
 			len *= 2;
 			buf = g_renew (char, buf, len);
 		}
 
-		if (res)
+		if (res == NULL)
 			result = NULL;
 	}
 #elif defined(HAVE_GETHOSTBYNAME_R_HPUX)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]