aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2004-06-09 15:16:17 +0000
committerBruce Momjian <bruce@momjian.us>2004-06-09 15:16:17 +0000
commit36b8654cb06843b9e23887771a01a28214cdd01c (patch)
tree2155f96e128cba0454245ebb68d9c50d0d3696ac
parenta1ccbb9019556aa8f8fa884702b19bd5f976c50d (diff)
downloadpostgresql-36b8654cb06843b9e23887771a01a28214cdd01c.tar.gz
postgresql-36b8654cb06843b9e23887771a01a28214cdd01c.zip
Use mkstemp instead of mktemp in thread test, per Jan.
-rw-r--r--src/tools/thread/thread_test.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tools/thread/thread_test.c b/src/tools/thread/thread_test.c
index 0210ebf0f1b..67b2db147b0 100644
--- a/src/tools/thread/thread_test.c
+++ b/src/tools/thread/thread_test.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.30 2004/05/28 18:37:10 momjian Exp $
+ * $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.31 2004/06/09 15:16:17 momjian Exp $
*
* This program tests to see if your standard libc functions use
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -104,7 +104,8 @@ main(int argc, char *argv[])
{
pthread_t thread1,
thread2;
-
+ int fd;
+
if (argc > 1)
{
fprintf(stderr, "Usage: %s\n", argv[0]);
@@ -120,11 +121,13 @@ main(int argc, char *argv[])
/* Make temp filenames, might not have strdup() */
temp_filename_1 = malloc(strlen(TEMP_FILENAME_1) + 1);
strcpy(temp_filename_1, TEMP_FILENAME_1);
- mktemp(temp_filename_1);
+ fd = mkstemp(temp_filename_1);
+ close(fd);
temp_filename_2 = malloc(strlen(TEMP_FILENAME_2) + 1);
strcpy(temp_filename_2, TEMP_FILENAME_2);
- mktemp(temp_filename_2);
+ fd = mkstemp(temp_filename_2);
+ close(fd);
#if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R)
if (gethostname(myhostname, MAXHOSTNAMELEN) != 0)