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
d6215574
Commit
d6215574
authored
Oct 22, 2019
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error.c: scope improvements
parent
f0742c7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
22 deletions
+11
-22
Error.c
nx-X11/programs/Xserver/hw/nxagent/Error.c
+11
-22
No files found.
nx-X11/programs/Xserver/hw/nxagent/Error.c
View file @
d6215574
...
...
@@ -325,16 +325,13 @@ void nxagentEndRedirectToClientsLog(void)
char
*
nxagentGetHomePath
(
void
)
{
char
*
homeEnv
;
char
*
homePath
;
if
(
*
nxagentHomeDir
==
'\0'
)
{
/*
* Check the NX_HOME environment.
*/
homeEnv
=
getenv
(
"NX_HOME"
);
char
*
homeEnv
=
getenv
(
"NX_HOME"
);
if
(
homeEnv
==
NULL
||
*
homeEnv
==
'\0'
)
{
...
...
@@ -369,7 +366,7 @@ char *nxagentGetHomePath(void)
#endif
}
homePath
=
strdup
(
nxagentHomeDir
);
char
*
homePath
=
strdup
(
nxagentHomeDir
);
if
(
homePath
==
NULL
)
{
...
...
@@ -385,19 +382,13 @@ char *nxagentGetHomePath(void)
char
*
nxagentGetRootPath
(
void
)
{
char
*
rootEnv
;
char
*
homeEnv
;
char
*
rootPath
;
struct
stat
dirStat
;
if
(
*
nxagentRootDir
==
'\0'
)
{
/*
* Check the NX_ROOT environment.
*/
rootEnv
=
getenv
(
"NX_ROOT"
);
char
*
rootEnv
=
getenv
(
"NX_ROOT"
);
if
(
rootEnv
==
NULL
||
*
rootEnv
==
'\0'
)
{
...
...
@@ -411,7 +402,7 @@ char *nxagentGetRootPath(void)
* settings.
*/
homeEnv
=
nxagentGetHomePath
();
char
*
homeEnv
=
nxagentGetHomePath
();
if
(
homeEnv
==
NULL
)
{
...
...
@@ -443,6 +434,8 @@ char *nxagentGetRootPath(void)
* Create the NX root directory.
*/
struct
stat
dirStat
;
if
((
stat
(
nxagentRootDir
,
&
dirStat
)
==
-
1
)
&&
(
errno
==
ENOENT
))
{
if
(
mkdir
(
nxagentRootDir
,
0777
)
<
0
&&
(
errno
!=
EEXIST
))
...
...
@@ -478,7 +471,7 @@ char *nxagentGetRootPath(void)
}
rootPath
=
strdup
(
nxagentRootDir
);
char
*
rootPath
=
strdup
(
nxagentRootDir
);
if
(
rootPath
==
NULL
)
{
...
...
@@ -494,12 +487,6 @@ char *nxagentGetRootPath(void)
char
*
nxagentGetSessionPath
(
void
)
{
char
*
rootPath
;
char
*
sessionPath
;
struct
stat
dirStat
;
if
(
*
nxagentSessionDir
==
'\0'
)
{
/*
...
...
@@ -518,7 +505,7 @@ char *nxagentGetSessionPath(void)
return
NULL
;
}
rootPath
=
nxagentGetRootPath
();
char
*
rootPath
=
nxagentGetRootPath
();
if
(
rootPath
==
NULL
)
{
...
...
@@ -544,6 +531,8 @@ char *nxagentGetSessionPath(void)
SAFE_free
(
rootPath
);
struct
stat
dirStat
;
if
((
stat
(
nxagentSessionDir
,
&
dirStat
)
==
-
1
)
&&
(
errno
==
ENOENT
))
{
if
(
mkdir
(
nxagentSessionDir
,
0777
)
<
0
&&
(
errno
!=
EEXIST
))
...
...
@@ -564,7 +553,7 @@ char *nxagentGetSessionPath(void)
}
sessionPath
=
strdup
(
nxagentSessionDir
);
char
*
sessionPath
=
strdup
(
nxagentSessionDir
);
if
(
sessionPath
==
NULL
)
{
...
...
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