Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
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
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
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
dCache
cta
Commits
3972063e
Commit
3972063e
authored
21 years ago
by
Jean-Damien Durand
Committed by
Steven Murray
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[bugs #3121] Cgetopt not thread-safe : replace 'place' variable with a thread-safe one
parent
c60918d8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mediachanger/castorrmc/common/Cgetopt.c
+20
-2
20 additions, 2 deletions
mediachanger/castorrmc/common/Cgetopt.c
with
20 additions
and
2 deletions
mediachanger/castorrmc/common/Cgetopt.c
+
20
−
2
View file @
3972063e
...
...
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
#ifndef lint
static
char
sccsid
[]
=
"@(#)$RCSfile: Cgetopt.c,v $ $Revision: 1.
5
$ $Date: 200
1
/0
9/18
1
9
:4
9:32
$ CERN IT-PDP/DM Jean-Damien Durand"
;
static
char
sccsid
[]
=
"@(#)$RCSfile: Cgetopt.c,v $ $Revision: 1.
6
$ $Date: 200
4
/0
4/22
1
6
:4
2:51
$ CERN IT-PDP/DM Jean-Damien Durand"
;
#endif
/* lint */
/* ============== */
...
...
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#)$RCSfile: Cgetopt.c,v $ $Revision: 1.5 $ $Date: 2001
/* ============= */
/* Local headers */
/* ============= */
#include
<Cglobals.h>
#include
<Cgetopt.h>
/* Our decls, especially TSD's */
#include
<Castor_limits.h>
/* For CA_MAXLINELEN */
...
...
@@ -52,6 +53,10 @@ static char sccsid[] = "@(#)$RCSfile: Cgetopt.c,v $ $Revision: 1.5 $ $Date: 2001
/* =================== */
static
char
*
_Cgetopt_progname
_PROTO
((
char
*
));
int
_Cgetopt_internal
_PROTO
((
int
,
char
*
CONST
*
,
CONST
char
*
));
static
char
**
C__place
_PROTO
(());
static
int
my_place
=
-
1
;
/* If Cglobals_get error in order not to crash */
#define place (*C__place())
static
char
*
my_place_static
=
""
;
static
char
*
_Cgetopt_progname
(
nargv0
)
char
*
nargv0
;
...
...
@@ -75,7 +80,6 @@ _Cgetopt_internal(nargc, nargv, ostr)
char
*
CONST
*
nargv
;
CONST
char
*
ostr
;
{
static
char
*
place
=
EMSG
;
/* option letter processing */
char
*
oli
;
/* option letter list index */
if
(
nargv
==
NULL
)
{
...
...
@@ -272,3 +276,17 @@ Cgetopt_long(nargc, nargv, options, long_options, index)
return
(
retval
);
}
static
char
**
C__place
()
{
char
**
var
;
/* Call Cglobals_get */
Cglobals_get
(
&
my_place
,
(
void
**
)
&
var
,
sizeof
(
char
*
)
);
/* If error, var will be NULL */
if
(
var
==
NULL
)
{
return
(
&
my_place_static
);
}
return
(
var
);
}
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