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.30 2004/05/28 18:37:10 momjian Exp $
9
+ * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.31 2004/06/09 15:16:17 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.
@@ -104,7 +104,8 @@ main(int argc, char *argv[])
104
104
{
105
105
pthread_t thread1 ,
106
106
thread2 ;
107
-
107
+ int fd ;
108
+
108
109
if (argc > 1 )
109
110
{
110
111
fprintf (stderr , "Usage: %s\n" , argv [0 ]);
@@ -120,11 +121,13 @@ main(int argc, char *argv[])
120
121
/* Make temp filenames, might not have strdup() */
121
122
temp_filename_1 = malloc (strlen (TEMP_FILENAME_1 ) + 1 );
122
123
strcpy (temp_filename_1 , TEMP_FILENAME_1 );
123
- mktemp (temp_filename_1 );
124
+ fd = mkstemp (temp_filename_1 );
125
+ close (fd );
124
126
125
127
temp_filename_2 = malloc (strlen (TEMP_FILENAME_2 ) + 1 );
126
128
strcpy (temp_filename_2 , TEMP_FILENAME_2 );
127
- mktemp (temp_filename_2 );
129
+ fd = mkstemp (temp_filename_2 );
130
+ close (fd );
128
131
129
132
#if !defined(HAVE_GETADDRINFO ) && !defined(HAVE_GETHOSTBYNAME_R )
130
133
if (gethostname (myhostname , MAXHOSTNAMELEN ) != 0 )
0 commit comments