6
6
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.9 2004/03/28 02:37:31 momjian Exp $
9
+ * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.10 2004/04/04 17:23:54 momjian Exp $
10
10
*
11
11
* This program tests to see if your standard libc functions use
12
12
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -105,7 +105,7 @@ void func_call_1(void) {
105
105
/* wait for other thread to set errno */
106
106
errno1_set = 1 ;
107
107
while (errno2_set == 0 )
108
- /* loop */ ;
108
+ getpid (); /* force system call */
109
109
if (errno != EEXIST )
110
110
{
111
111
fprintf (stderr , "errno not thread-safe; exiting\n" );
@@ -128,8 +128,8 @@ void func_call_1(void) {
128
128
passwd_p1 = NULL ; /* force thread-safe failure report */
129
129
}
130
130
131
- hostent_p1 = gethostbyname ("yahoo.com" );
132
- p = gethostbyname ("slashdot.org " );
131
+ hostent_p1 = gethostbyname ("www. yahoo.com" );
132
+ p = gethostbyname ("www.weather.com " );
133
133
if (hostent_p1 != p )
134
134
{
135
135
printf ("Your gethostbyname() changes the static memory area between calls\n" );
@@ -151,7 +151,7 @@ void func_call_2(void) {
151
151
/* wait for other thread to set errno */
152
152
errno2_set = 1 ;
153
153
while (errno1_set == 0 )
154
- /* loop */ ;
154
+ getpid (); /* force system call */
155
155
if (errno != ENOENT )
156
156
{
157
157
fprintf (stderr , "errno not thread-safe; exiting\n" );
@@ -174,8 +174,8 @@ void func_call_2(void) {
174
174
passwd_p2 = NULL ; /* force thread-safe failure report */
175
175
}
176
176
177
- hostent_p2 = gethostbyname ("google.com" );
178
- p = gethostbyname ("postgresql.org" );
177
+ hostent_p2 = gethostbyname ("www. google.com" );
178
+ p = gethostbyname ("www. postgresql.org" );
179
179
if (hostent_p2 != p )
180
180
{
181
181
printf ("Your gethostbyname() changes the static memory area between calls\n" );
0 commit comments