Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.windows.x Subject: Re: Help Please: How do I find out if X-windows is running? Message-ID: <7760@auspex.auspex.com> Date: 12 May 91 18:00:28 GMT References: <1991May10.174504.2575@odetics.com> Distribution: na Organization: Auspex Systems, Santa Clara Lines: 15 >I am working on my first Xview program. By chance I tried it last >night via modem expecting it to give me "no server available" or >some such thing. Instead it gave me a segmentation fault (Sun 386i). That's a bug in XView; the code that tries to print the "no server available" message is broken, and assumes that the DISPLAY environment variable is set, and therefore that the pointer returned by 'getenv("DISPLAY")' can safely be dereferenced. Needless to say, that is *not* necessarily true. I posted a fix for it to "comp.windows.open-look" a while ago; a workaround might be to try doing an "XOpenDisplay()" call yourself (you might not want to just check whether DISPLAY is set, because a lot of programs will just try to open ":0" if it's not, rather than assuming X isn't up) and see if it succeeds.