summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-11-25 11:25:58 -0800
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-11-25 11:53:12 -0800
commiteb474adf98229a43bbe17ab98ff084371cb9fa09 (patch)
tree1d70144e0dc30694fcda2478ebc21e9ea133d15e /hw
parent94df1ab7f09a64f57c1e1453e3640462e984619c (diff)
XQuartz: Simplify the xquartz_resetenv_display path
(cherry picked from commit d2e0624dd30eb234bb25595ceedfa51d48ca1724)
Diffstat (limited to 'hw')
-rw-r--r--hw/xquartz/X11Controller.m12
1 files changed, 1 insertions, 11 deletions
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index ae9429c3e..233fd4f1d 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -321,16 +321,6 @@ BOOL xquartz_resetenv_display = NO;
int child1, child2 = 0;
int status;
- if(xquartz_resetenv_display) {
- char _display[32];
- size_t i;
- for(i=0; !display && i < 5; i++)
- sleep(1);
-
- snprintf(_display, sizeof(_display), ":%s", display);
- setenv("DISPLAY", _display, TRUE);
- }
-
argv[0] = "/usr/bin/login";
argv[1] = "-fp";
argv[2] = getlogin();
@@ -368,7 +358,7 @@ BOOL xquartz_resetenv_display = NO;
/* Setup environment */
temp = getenv("DISPLAY");
- if (temp == NULL || temp[0] == 0) {
+ if (xquartz_resetenv_display || temp == NULL || temp[0] == 0) {
snprintf(buf, sizeof(buf), ":%s", display);
setenv("DISPLAY", buf, TRUE);
}