XQuartz: Remove the redundant xquartz_resetenv_display
unsetenv(DISPLAY) takes care of this for us anyway (cherry picked from commit d2263645d839c9edeedea0835d26f1f41b37f70e)
This commit is contained in:
parent
9b98b88322
commit
f3223c71cf
|
@ -52,8 +52,6 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
BOOL xquartz_resetenv_display = NO;
|
|
||||||
|
|
||||||
@implementation X11Controller
|
@implementation X11Controller
|
||||||
|
|
||||||
- (void) awakeFromNib
|
- (void) awakeFromNib
|
||||||
|
@ -353,7 +351,7 @@ BOOL xquartz_resetenv_display = NO;
|
||||||
newargv[3] = NULL;
|
newargv[3] = NULL;
|
||||||
|
|
||||||
s = getenv("DISPLAY");
|
s = getenv("DISPLAY");
|
||||||
if (xquartz_resetenv_display || s == NULL || s[0] == 0) {
|
if (s == NULL || s[0] == 0) {
|
||||||
snprintf(buf, sizeof(buf), ":%s", display);
|
snprintf(buf, sizeof(buf), ":%s", display);
|
||||||
setenv("DISPLAY", buf, TRUE);
|
setenv("DISPLAY", buf, TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,6 @@ void DarwinListenOnOpenFD(int fd);
|
||||||
|
|
||||||
extern int noPanoramiXExtension;
|
extern int noPanoramiXExtension;
|
||||||
|
|
||||||
extern int xquartz_resetenv_display;
|
|
||||||
|
|
||||||
#define DEFAULT_CLIENT X11BINDIR "/xterm"
|
#define DEFAULT_CLIENT X11BINDIR "/xterm"
|
||||||
#define DEFAULT_STARTX X11BINDIR "/startx"
|
#define DEFAULT_STARTX X11BINDIR "/startx"
|
||||||
#define DEFAULT_SHELL "/bin/sh"
|
#define DEFAULT_SHELL "/bin/sh"
|
||||||
|
@ -429,9 +427,6 @@ static int startup_trigger(int argc, char **argv, char **envp) {
|
||||||
if((s = getenv("DISPLAY"))) {
|
if((s = getenv("DISPLAY"))) {
|
||||||
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s);
|
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s);
|
||||||
unsetenv("DISPLAY");
|
unsetenv("DISPLAY");
|
||||||
|
|
||||||
/* This tells X11Controller to not use the environment's DISPLAY and reset it based on the server's display */
|
|
||||||
xquartz_resetenv_display = 1;
|
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n");
|
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue