Re: (fwd) tin crashes on MacOS 10.4

Urs Janssen <[email protected]> Thu, 31 Dec 2009 18:23:55 +0100
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On Tue, Dec 29, 2009 at 07:42:28PM -0500, Thomas Dickey wrote:
>>>> ...or perhaps there's some Apple-define that turns on the bulk of things
>>>> without aggravating anything.  There are several special cases in
>>>> CF_XOPEN_SOURCE for other systems.
>>>
>>> no MacOS X here but
>>> <http://svn.python.org/projects/python/branches/py3k/configure.in>
>>> has some comments on defining _XOPEN_SOURCE on various systems and if I
>>> didn't overlook something a fix for CF_XOPEN_SOURCE would be:
>>>
>>> darwin*) #(vi
>>> 	CPPFLAGS="$CPPFLAGS -D_DARWIN_C_SOURCE"
>>> 	;;
>>
>> No problems here with this (MacOS X 10.4).
>
> sounds good (will update my copy of the macro, and send a resync - I have 
> other changes, of course...).

below is an alternative way to fix this - btw. the networing code seems to be
broken for bsd <= 4.2 which do not have the addr_list stuff, just
testing for #ifndef h_addr (backward compatibe macro for the first element
of the list) is not enought as the list isn't available at all, but I don't
think it's worth fixing that (bsd4.3 was released about 1987 and has the
address-list).

--- nntplib.c.o	2009-12-31 17:46:09.178797818 +0100
+++ nntplib.c	2009-12-31 18:03:55.774476978 +0100
@@ -410,8 +410,8 @@
 #			ifdef h_addr
 	int x = 0;
 	char **cp;
-	static char *alist[2] = {0, 0};
 #			endif /* h_addr */
+	static char *alist[2] = {0, 0};
 	static struct hostent def;
 	static struct in_addr defaddr;
 	static char namebuf[256];
@@ -442,9 +442,9 @@
 		/* Raw ip address, fake */
 		STRCPY(namebuf, machine);
 		def.h_name = (char *) namebuf;
-#			ifdef h_addr
+/*#			ifdef h_addr*/
 		def.h_addr_list = alist;
-#			endif /* h_addr */
+/*#			endif*/ /* h_addr */
 		def.h_addr_list[0] = (char *) &defaddr;
 		def.h_length = sizeof(struct in_addr);
 		def.h_addrtype = AF_INET;