aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog4
-rw-r--r--src/xterm.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0324d958aa4..e476eac4a3e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12007-09-10 Richard Stallman <rms@gnu.org>
2
3 * xterm.c (x_term_init): Give error if can't open DISPLAY_NAME.
4
12007-09-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> 52007-09-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name>
2 6
3 * lisp.h (struct Lisp_Subr): Rename `prompt' field to `intspec'. 7 * lisp.h (struct Lisp_Subr): Rename `prompt' field to `intspec'.
diff --git a/src/xterm.c b/src/xterm.c
index 0e56b04c1b0..af35fbe8799 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10586,9 +10586,12 @@ get_bits_and_offset (mask, bits, offset)
10586 *bits = nr; 10586 *bits = nr;
10587} 10587}
10588 10588
10589/* Return 1 if display DISPLAY is available for use, 0 otherwise.
10590 But don't permanently open it, just test its availability. */
10591
10589int 10592int
10590x_display_ok (display) 10593x_display_ok (display)
10591 const char * display; 10594 const char *display;
10592{ 10595{
10593 int dpy_ok = 1; 10596 int dpy_ok = 1;
10594 Display *dpy; 10597 Display *dpy;
@@ -10601,6 +10604,10 @@ x_display_ok (display)
10601 return dpy_ok; 10604 return dpy_ok;
10602} 10605}
10603 10606
10607/* Open a connection to X display DISPLAY_NAME, and return
10608 the structure that describes the open display.
10609 If we cannot contact the display, return null. */
10610
10604struct x_display_info * 10611struct x_display_info *
10605x_term_init (display_name, xrm_option, resource_name) 10612x_term_init (display_name, xrm_option, resource_name)
10606 Lisp_Object display_name; 10613 Lisp_Object display_name;
@@ -10621,6 +10628,9 @@ x_term_init (display_name, xrm_option, resource_name)
10621 ++x_initialized; 10628 ++x_initialized;
10622 } 10629 }
10623 10630
10631 if (! x_display_ok (SDATA (display_name)))
10632 error ("Display %s can't be opened", SDATA (display_name));
10633
10624#ifdef USE_GTK 10634#ifdef USE_GTK
10625 { 10635 {
10626#define NUM_ARGV 10 10636#define NUM_ARGV 10