Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
xserver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
Adam Jackson
xserver
Commits
cbae2b44
Commit
cbae2b44
authored
Nov 28, 2008
by
Jeremy Huddleston
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XQuarz: Setup our PATH and PWD earlier, so our initial client benefits from it as well...
parent
807f2ec3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
16 deletions
+29
-16
hw/xquartz/X11Controller.m
hw/xquartz/X11Controller.m
+1
-14
hw/xquartz/mach-startup/Makefile.am
hw/xquartz/mach-startup/Makefile.am
+2
-1
hw/xquartz/mach-startup/bundle-main.c
hw/xquartz/mach-startup/bundle-main.c
+26
-1
No files found.
hw/xquartz/X11Controller.m
View file @
cbae2b44
...
...
@@ -34,8 +34,6 @@
#include <dix-config.h>
#endif
#define DEFAULT_PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin"
#include "quartzCommon.h"
#import "X11Controller.h"
...
...
@@ -362,18 +360,7 @@ BOOL xquartz_resetenv_display = NO;
snprintf
(
buf
,
sizeof
(
buf
),
":%s"
,
display
);
setenv
(
"DISPLAY"
,
buf
,
TRUE
);
}
temp
=
getenv
(
"PATH"
);
if
(
temp
==
NULL
||
temp
[
0
]
==
0
)
setenv
(
"PATH"
,
DEFAULT_PATH
,
TRUE
);
else
if
(
strnstr
(
temp
,
"/usr/X11/bin"
,
sizeof
(
temp
))
==
NULL
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"%s:/usr/X11/bin"
,
temp
);
setenv
(
"PATH"
,
buf
,
TRUE
);
}
/* cd $HOME */
temp
=
getenv
(
"HOME"
);
if
(
temp
!=
NULL
&&
temp
[
0
]
!=
0
)
chdir
(
temp
);
execvp
(
argv
[
0
],
(
char
**
const
)
argv
);
_exit
(
2
);
...
...
hw/xquartz/mach-startup/Makefile.am
View file @
cbae2b44
AM_CPPFLAGS
=
\
-DBUILD_DATE
=
\"
$(BUILD_DATE)
\"
\
-DXSERVER_VERSION
=
\"
$(VERSION)
\"
-DXSERVER_VERSION
=
\"
$(VERSION)
\"
\
-DX11BINDIR
=
\"
$(bindir)
\"
x11appdir
=
$(APPLE_APPLICATIONS_DIR)
/X11.app/Contents/MacOS
x11app_PROGRAMS
=
X11
...
...
hw/xquartz/mach-startup/bundle-main.c
View file @
cbae2b44
...
...
@@ -419,6 +419,28 @@ int startup_trigger(int argc, char **argv, char **envp) {
return
execute
(
command_from_prefs
(
"startx_script"
,
DEFAULT_STARTX
));
}
/** Setup the environment we want our child processes to inherit */
static
void
setup_env
()
{
char
buf
[
1024
],
*
temp
;
/* Make sure /usr/X11/bin is in the $PATH */
temp
=
getenv
(
"PATH"
);
if
(
temp
==
NULL
||
temp
[
0
]
==
0
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:%s"
,
X11BINDIR
);
setenv
(
"PATH"
,
buf
,
TRUE
);
}
else
if
(
strnstr
(
temp
,
X11BINDIR
,
sizeof
(
temp
))
==
NULL
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"%s:%s"
,
temp
,
X11BINDIR
);
setenv
(
"PATH"
,
buf
,
TRUE
);
}
fprintf
(
stderr
,
"PATH: %s
\n
"
,
getenv
(
"PATH"
));
/* cd $HOME */
temp
=
getenv
(
"HOME"
);
if
(
temp
!=
NULL
&&
temp
[
0
]
!=
'\0'
)
chdir
(
temp
);
}
/*** Main ***/
int
main
(
int
argc
,
char
**
argv
,
char
**
envp
)
{
Bool
listenOnly
=
FALSE
;
...
...
@@ -427,7 +449,10 @@ int main(int argc, char **argv, char **envp) {
mach_port_t
mp
;
kern_return_t
kr
;
// The server must not run the PanoramiX operations.
/* Setup our environment for our children */
setup_env
();
/* The server must not run the PanoramiX operations. */
noPanoramiXExtension
=
TRUE
;
/* Setup the initial crasherporter info */
...
...
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