Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36b8654

Browse files
committed
Use mkstemp instead of mktemp in thread test, per Jan.
1 parenta1ccbb9 commit36b8654

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎src/tools/thread/thread_test.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
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 $
1010
*
1111
*This program tests to see if your standard libc functions use
1212
*pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -104,7 +104,8 @@ main(int argc, char *argv[])
104104
{
105105
pthread_tthread1,
106106
thread2;
107-
107+
intfd;
108+
108109
if (argc>1)
109110
{
110111
fprintf(stderr,"Usage: %s\n",argv[0]);
@@ -120,11 +121,13 @@ main(int argc, char *argv[])
120121
/* Make temp filenames, might not have strdup() */
121122
temp_filename_1=malloc(strlen(TEMP_FILENAME_1)+1);
122123
strcpy(temp_filename_1,TEMP_FILENAME_1);
123-
mktemp(temp_filename_1);
124+
fd=mkstemp(temp_filename_1);
125+
close(fd);
124126

125127
temp_filename_2=malloc(strlen(TEMP_FILENAME_2)+1);
126128
strcpy(temp_filename_2,TEMP_FILENAME_2);
127-
mktemp(temp_filename_2);
129+
fd=mkstemp(temp_filename_2);
130+
close(fd);
128131

129132
#if !defined(HAVE_GETADDRINFO)&& !defined(HAVE_GETHOSTBYNAME_R)
130133
if (gethostname(myhostname,MAXHOSTNAMELEN)!=0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp