plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit e113e0a4bbc3024c43f008d17f618950b0ae20af
parent 9142d36228acc954b289705244ce2477187091e9
Author: Russ Cox <rsc@swtch.com>
Date:   Mon, 30 Jun 2008 19:41:24 -0400

lib9: allow no $DISPLAY on OS X in getns

Diffstat:
Msrc/lib9/getns.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/lib9/getns.c b/src/lib9/getns.c @@ -29,8 +29,15 @@ nsfromdisplay(void) char *disp, *p; 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"); return nil; +#endif } /* canonicalize: xxx:0.0 => xxx:0 */