Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
b803cf43
Commit
b803cf43
authored
21 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Clean up thread test program.
parent
db9a9576
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tools/thread/thread_test.c
+9
-9
9 additions, 9 deletions
src/tools/thread/thread_test.c
with
9 additions
and
9 deletions
src/tools/thread/thread_test.c
+
9
−
9
View file @
b803cf43
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.
8
2004/03/2
7 23:02:44
momjian Exp $
* $PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.
9
2004/03/2
8 02:37:31
momjian Exp $
*
*
* This program tests to see if your standard libc functions use
* This program tests to see if your standard libc functions use
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
...
@@ -93,15 +93,13 @@ defines to your template/$port file before compiling this program.\n\n"
...
@@ -93,15 +93,13 @@ defines to your template/$port file before compiling this program.\n\n"
void
func_call_1
(
void
)
{
void
func_call_1
(
void
)
{
void
*
p
;
void
*
p
;
if
(
open
(
"/tmp/thread_test.1"
,
O_RDWR
|
O_CREAT
,
0600
)
<
0
)
unlink
(
"/tmp/thread_test.1"
);
{
/* create, then try to fail on exclusive create open */
fprintf
(
stderr
,
"Could not create file in /tmp, exiting
\n
"
);
if
(
open
(
"/tmp/thread_test.1"
,
O_RDWR
|
O_CREAT
,
0600
)
<
0
||
exit
(
1
);
open
(
"/tmp/thread_test.1"
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
0600
)
>=
0
)
}
if
(
open
(
"/tmp/thread_test.1"
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
0600
)
>=
0
)
{
{
fprintf
(
stderr
,
"Could not generate failure for create file in /tmp, exiting
\n
"
);
fprintf
(
stderr
,
"Could not create file in /tmp or
\n
"
);
fprintf
(
stderr
,
"could not generate failure for create file in /tmp, exiting
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
/* wait for other thread to set errno */
/* wait for other thread to set errno */
...
@@ -144,6 +142,7 @@ void func_call_2(void) {
...
@@ -144,6 +142,7 @@ void func_call_2(void) {
void
*
p
;
void
*
p
;
unlink
(
"/tmp/thread_test.2"
);
unlink
(
"/tmp/thread_test.2"
);
/* open non-existant file */
if
(
open
(
"/tmp/thread_test.2"
,
O_RDONLY
,
0600
)
>=
0
)
if
(
open
(
"/tmp/thread_test.2"
,
O_RDONLY
,
0600
)
>=
0
)
{
{
fprintf
(
stderr
,
"Read-only open succeeded without create, exiting
\n
"
);
fprintf
(
stderr
,
"Read-only open succeeded without create, exiting
\n
"
);
...
@@ -159,6 +158,7 @@ void func_call_2(void) {
...
@@ -159,6 +158,7 @@ void func_call_2(void) {
unlink
(
"/tmp/thread_test.A"
);
unlink
(
"/tmp/thread_test.A"
);
exit
(
1
);
exit
(
1
);
}
}
unlink
(
"/tmp/thread_test.2"
);
strerror_p2
=
strerror
(
EINVAL
);
strerror_p2
=
strerror
(
EINVAL
);
/*
/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment