Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
3c9ee1ff
You need to sign in or sign up before continuing.
Commit
3c9ee1ff
authored
May 08, 2019
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nxagent: Determine nxagentProgName only once
also add TEST prints, init nxagentProgName with NULL and add const where it was missing. Fixes ArcticaProject/nx-libs#803
parent
4ce89075
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+21
-7
Init.c
nx-X11/programs/Xserver/hw/nxagent/Init.c
+6
-1
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
3c9ee1ff
...
...
@@ -126,7 +126,7 @@ extern int _XGetBitsPerPixel(Display *dpy, int depth);
extern
char
dispatchExceptionAtReset
;
c
har
*
nxagentProgName
;
c
onst
char
*
nxagentProgName
=
NULL
;
char
nxagentDisplayName
[
NXAGENTDISPLAYNAMELENGTH
];
Bool
nxagentSynchronize
=
False
;
...
...
@@ -186,17 +186,31 @@ char *nxagentKeystrokeFile = NULL;
int
ddxProcessArgument
(
int
argc
,
char
*
argv
[],
int
i
)
{
/*
* Ensure that the options are set to their defaults.
* The flavour can never change, so only set it once.
*
* FIXME: ddxProcessArgument() is called once for every command line
* argument, with argv[0] being the argument and not the program
* name! We should move this check somewhere else.
*/
if
(
nxagentProgName
==
NULL
)
{
char
*
basec
=
strdup
(
argv
[
0
]);
nxagentProgName
=
strdup
(
basename
(
basec
));
free
(
basec
);
char
*
basec
=
strdup
(
argv
[
0
]);
nxagentProgName
=
strdup
(
basename
(
basec
));
free
(
basec
);
/*
* Check if we are running as X2Go Agent
*/
checkX2goAgent
();
}
#ifdef TEST
fprintf
(
stderr
,
"%s: argv[0] [%s] nxagentProgName [%s]
\n
"
,
__func__
,
argv
[
0
],
nxagentProgName
);
#endif
/*
*
Check if we running as X2Go Agent
*
Ensure that the options are set to their defaults.
*/
checkX2goAgent
();
static
Bool
resetOptions
=
True
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Init.c
View file @
3c9ee1ff
...
...
@@ -194,7 +194,12 @@ int nxagentX2go;
void
checkX2goAgent
(
void
)
{
extern
char
*
nxagentProgName
;
extern
const
char
*
nxagentProgName
;
#ifdef TEST
fprintf
(
stderr
,
"%s: nxagentProgName [%s]
\n
"
,
__func__
,
nxagentProgName
);
#endif
if
(
strcasecmp
(
nxagentProgName
,
"x2goagent"
)
==
0
)
{
fprintf
(
stderr
,
"
\n
running as X2Go Agent
\n
"
);
...
...
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