# HG changeset patch # User Richard M. Stallman # Date 1189445641 0 # Node ID 04182505543bb8dd150db93cdb06e5ba5ed62542 # Parent 371bf4ba333bbe3700995dabb6d9ed9d31133071 (x_term_init): Give error if can't open DISPLAY_NAME. diff -r 371bf4ba333b -r 04182505543b src/xterm.c --- a/src/xterm.c Mon Sep 10 17:25:58 2007 +0000 +++ b/src/xterm.c Mon Sep 10 17:34:01 2007 +0000 @@ -10586,9 +10586,12 @@ *bits = nr; } +/* Return 1 if display DISPLAY is available for use, 0 otherwise. + But don't permanently open it, just test its availability. */ + int x_display_ok (display) - const char * display; + const char *display; { int dpy_ok = 1; Display *dpy; @@ -10601,6 +10604,10 @@ return dpy_ok; } +/* Open a connection to X display DISPLAY_NAME, and return + the structure that describes the open display. + If we cannot contact the display, return null. */ + struct x_display_info * x_term_init (display_name, xrm_option, resource_name) Lisp_Object display_name; @@ -10621,6 +10628,9 @@ ++x_initialized; } + if (! x_display_ok (SDATA (display_name))) + error ("Display %s can't be opened", SDATA (display_name)); + #ifdef USE_GTK { #define NUM_ARGV 10