lib9: allow no $DISPLAY on OS X in getns
This commit is contained in:
parent
9142d36228
commit
e113e0a4bb
1 changed files with 7 additions and 0 deletions
|
|
@ -29,8 +29,15 @@ nsfromdisplay(void)
|
||||||
char *disp, *p;
|
char *disp, *p;
|
||||||
|
|
||||||
if((disp = getenv("DISPLAY")) == nil){
|
if((disp = getenv("DISPLAY")) == nil){
|
||||||
|
#ifdef __APPLE__
|
||||||
|
// Might be running native GUI on OS X.
|
||||||
|
disp = strdup(":0.0");
|
||||||
|
if(disp == nil)
|
||||||
|
return nil;
|
||||||
|
#else
|
||||||
werrstr("$DISPLAY not set");
|
werrstr("$DISPLAY not set");
|
||||||
return nil;
|
return nil;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* canonicalize: xxx:0.0 => xxx:0 */
|
/* canonicalize: xxx:0.0 => xxx:0 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue