Index: src/tools/thread/thread_test.c =================================================================== RCS file: /cvsroot/pgsql-server/src/tools/thread/thread_test.c,v retrieving revision 1.10 diff -c -c -r1.10 thread_test.c *** src/tools/thread/thread_test.c 4 Apr 2004 17:23:54 -0000 1.10 --- src/tools/thread/thread_test.c 5 Apr 2004 01:22:04 -0000 *************** *** 35,40 **** --- 35,42 ---- void func_call_1(void); void func_call_2(void); + char myhostname[MAXHOSTNAMELEN]; + int errno1_set = 0; int errno2_set = 0; *************** *** 61,66 **** --- 63,74 ---- return 1; } + if (gethostname(myhostname, MAXHOSTNAMELEN) != 0) + { + fprintf(stderr, "can not get local hostname, exiting\n"); + exit(1); + } + printf("\ Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'\n\ defines to your template/$port file before compiling this program.\n\n" *************** *** 128,135 **** passwd_p1 = NULL; /* force thread-safe failure report */ } ! hostent_p1 = gethostbyname("www.yahoo.com"); ! p = gethostbyname("www.weather.com"); if (hostent_p1 != p) { printf("Your gethostbyname() changes the static memory area between calls\n"); --- 136,144 ---- passwd_p1 = NULL; /* force thread-safe failure report */ } ! /* threads do this in opposite order */ ! hostent_p1 = gethostbyname(myhostname); ! p = gethostbyname("localhost"); if (hostent_p1 != p) { printf("Your gethostbyname() changes the static memory area between calls\n"); *************** *** 174,181 **** passwd_p2 = NULL; /* force thread-safe failure report */ } ! hostent_p2 = gethostbyname("www.google.com"); ! p = gethostbyname("www.postgresql.org"); if (hostent_p2 != p) { printf("Your gethostbyname() changes the static memory area between calls\n"); --- 183,191 ---- passwd_p2 = NULL; /* force thread-safe failure report */ } ! /* threads do this in opposite order */ ! hostent_p2 = gethostbyname("localhost"); ! p = gethostbyname(myhostname); if (hostent_p2 != p) { printf("Your gethostbyname() changes the static memory area between calls\n");