[comp.windows.x] XOpenDisplay failing "sometimes"

evt@dlcdev.UUCP (Eric Van Tassell) (11/30/88)

When XOpenDisplay fails is there something I can do to figure out why?
TIA.


		dlcdev!eric@eddie.mit.edu

net@TUB.BITNET (Oliver Laumann) (12/02/88)

> When XOpenDisplay fails is there something I can do to figure out why?

Unfortunately, you can't.  I found this out yesterday when I tried to
run a program under 4.3 BSD that has been compiled and linked together
with the Xlib under 4.2 BSD.  XOpenDisplay() refused to open the
display, although the program worked fine under 4.2 BSD.

In my desparation I put a printf() in front of each "return NULL" and
"return -1" in XOpenDis.c and XConnDis.c and linked the program with
the hacked XOpenDis.o and XConnDis.o to find out that the connect()
failed with an errno of EHOSTUNREACH.  The reason for this is an
incompatibility between the 4.2 and 4.3 gethostbyname().

It had saved me at least half an hour of time if there were a way to
find out why XOpenDisplay() failed, possibly together with the errno if
applicable.

--
Regards,
    Oliver Laumann, Technical University of Berlin, Germany.
    ...!pyramid!tub!net   or   net@TUB.BITNET