Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!spool.mu.edu!uunet!odetics!frank From: frank@odetics.com (Frank Merrow) Newsgroups: comp.windows.x Subject: Help Please: How do I find out if X-windows is running? Message-ID: <1991May10.174504.2575@odetics.com> Date: 10 May 91 17:45:04 GMT Reply-To: frank@odetics.com (Frank Merrow) Distribution: na Organization: Odetics, Inc., Anaheim, CA Lines: 39 Hi, 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). This morning at work I also tried to run it from another X11 system and have it display on my system using -display=mars:0 and again I got a segmentation fault. I have included my startup code below (which works WHEN running on my station under OpenLook) All it ever prints in the other two cases is "Hi There". Any Ideas? Frank frank@odetics.com or uunet!odetics!frank P.S. From the xview book it is not clear what xv_init() returns on error (something about a Server). At any rate the NULL check was a wild idea on my part. But the bottom line seems to be that once I call xv_init() I will abort if the server is not available. Is there something I can/should be calling first to test for it? main (argc,argv) int argc; char *argv[]; { int event_mask; /* I will start by initializing XView and creating my Base Frame. */ printf("Hi There\n"); if (xv_init (XV_INIT_ARGC_PTR_ARGV,&argc,argv,NULL) == NULL) { printf("xv_init() Error - Are you sure you are running X11?\n"); exit (1); } printf("Hi Again\n"); . . .