Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
5473f283
Commit
5473f283
authored
Aug 22, 2011
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly call strerror() in thread test; add comments.
parent
e319ec4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/test/thread/thread_test.c
src/test/thread/thread_test.c
+7
-2
No files found.
src/test/thread/thread_test.c
View file @
5473f283
...
...
@@ -157,7 +157,7 @@ main(int argc, char *argv[])
if
(
rc
!=
0
)
{
fprintf
(
stderr
,
"Failed to create thread 1: %s **
\n
exiting
\n
"
,
strerror
(
rc
));
strerror
(
errno
));
exit
(
1
);
}
rc
=
pthread_create
(
&
thread2
,
NULL
,
(
void
*
(
*
)
(
void
*
))
func_call_2
,
NULL
);
...
...
@@ -285,6 +285,11 @@ func_call_1(void)
/* Set errno = EEXIST */
/* create, then try to fail on exclusive create open */
/*
* It would be great to check errno here but if errno is not thread-safe
* we might get a value from the other thread and mis-report the cause
* of the failure.
*/
#ifdef WIN32
if
((
h1
=
CreateFile
(
TEMP_FILENAME_1
,
GENERIC_WRITE
,
0
,
NULL
,
OPEN_ALWAYS
,
0
,
NULL
))
==
INVALID_HANDLE_VALUE
)
...
...
@@ -299,7 +304,7 @@ func_call_1(void)
#ifdef WIN32
if
(
CreateFile
(
TEMP_FILENAME_1
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
0
,
NULL
)
!=
INVALID_HANDLE_VALUE
||
GetLastError
()
!=
ERROR_FILE_EXISTS
)
!=
INVALID_HANDLE_VALUE
)
#else
if
(
open
(
TEMP_FILENAME_1
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
0600
)
>=
0
)
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment