natInetAddress.cc (lookup): On glibc2.0 systems, make buffer larger to work around bug.

* java/net/natInetAddress.cc (lookup): On glibc2.0 systems, make
	buffer larger to work around bug.
	From Bryce McKinlay <bryce@albatross.co.nz>.

From-SVN: r26447
This commit is contained in:
Tom Tromey 1999-04-14 11:07:51 +00:00 committed by Tom Tromey
parent d8265d2995
commit 9ce392afc1
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,9 @@
1999-04-14 Tom Tromey <tromey@cygnus.com>
* java/net/natInetAddress.cc (lookup): On glibc2.0 systems, make
buffer larger to work around bug.
From Bryce McKinlay <bryce@albatross.co.nz>.
1999-04-14 Andrew Haley <aph@cygnus.com>
* java/lang/natDouble.java (doubleToLongBits): ensure that all

View File

@ -97,7 +97,14 @@ java::net::InetAddress::lookup (jstring host, java::net::InetAddress* iaddr,
struct hostent *hptr = NULL;
#if defined (HAVE_GETHOSTBYNAME_R) || defined (HAVE_GETHOSTBYADDR_R)
struct hostent hent_r;
#if defined (__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ == 0
// glibc 2.0.7 has a bug where gethostbyname_r won't return an error
// if the buffer is too small. So in this case we size the buffer
// the same way that glibc does. This is fixed in glibc 2.1.
char fixed_buffer[1024];
#else
char fixed_buffer[200];
#endif
char *buffer_r = fixed_buffer;
int size_r = sizeof (fixed_buffer);
#endif