diff options
| author | Jan D | 2015-03-29 21:16:23 +0200 |
|---|---|---|
| committer | Jan D | 2015-03-29 21:16:23 +0200 |
| commit | 4d2e7e17547edda414129aeee910cd0334b4e85e (patch) | |
| tree | d9806041631af077927be2ca86794a46a7ca1a01 /src/xterm.c | |
| parent | 2e0cfccde648072f34e83fe55b5fa37f1d11ccb7 (diff) | |
| download | emacs-4d2e7e17547edda414129aeee910cd0334b4e85e.tar.gz emacs-4d2e7e17547edda414129aeee910cd0334b4e85e.zip | |
Fixes: debbugs:19175
* gtkutil.c (xg_display_open):
* xterm.c (x_display_ok, x_term_init): Block SIGIO when opening
a display.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c index 4ca1e131e67..2ac2fe84e52 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -9719,7 +9719,11 @@ get_bits_and_offset (unsigned long mask, int *bits, int *offset) | |||
| 9719 | bool | 9719 | bool |
| 9720 | x_display_ok (const char *display) | 9720 | x_display_ok (const char *display) |
| 9721 | { | 9721 | { |
| 9722 | Display *dpy = XOpenDisplay (display); | 9722 | Display *dpy; |
| 9723 | // XOpenDisplay fails if it gets a signal. Block SIGIO which may arrive. | ||
| 9724 | unrequest_sigio (); | ||
| 9725 | dpy = XOpenDisplay (display); | ||
| 9726 | request_sigio (); | ||
| 9723 | return dpy ? (XCloseDisplay (dpy), 1) : 0; | 9727 | return dpy ? (XCloseDisplay (dpy), 1) : 0; |
| 9724 | } | 9728 | } |
| 9725 | 9729 | ||
| @@ -9811,7 +9815,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 9811 | 9815 | ||
| 9812 | /* gtk_init does set_locale. Fix locale before and after. */ | 9816 | /* gtk_init does set_locale. Fix locale before and after. */ |
| 9813 | fixup_locale (); | 9817 | fixup_locale (); |
| 9818 | unrequest_sigio (); // See comment in x_display_ok. | ||
| 9814 | gtk_init (&argc, &argv2); | 9819 | gtk_init (&argc, &argv2); |
| 9820 | request_sigio (); | ||
| 9815 | fixup_locale (); | 9821 | fixup_locale (); |
| 9816 | 9822 | ||
| 9817 | g_log_remove_handler ("GLib", id); | 9823 | g_log_remove_handler ("GLib", id); |
| @@ -9861,10 +9867,12 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 9861 | argv[argc++] = xrm_option; | 9867 | argv[argc++] = xrm_option; |
| 9862 | } | 9868 | } |
| 9863 | turn_on_atimers (0); | 9869 | turn_on_atimers (0); |
| 9870 | unrequest_sigio (); // See comment in x_display_ok. | ||
| 9864 | dpy = XtOpenDisplay (Xt_app_con, SSDATA (display_name), | 9871 | dpy = XtOpenDisplay (Xt_app_con, SSDATA (display_name), |
| 9865 | resource_name, EMACS_CLASS, | 9872 | resource_name, EMACS_CLASS, |
| 9866 | emacs_options, XtNumber (emacs_options), | 9873 | emacs_options, XtNumber (emacs_options), |
| 9867 | &argc, argv); | 9874 | &argc, argv); |
| 9875 | request_sigio (); | ||
| 9868 | turn_on_atimers (1); | 9876 | turn_on_atimers (1); |
| 9869 | 9877 | ||
| 9870 | #ifdef HAVE_X11XTR6 | 9878 | #ifdef HAVE_X11XTR6 |
| @@ -9875,7 +9883,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 9875 | 9883 | ||
| 9876 | #else /* not USE_X_TOOLKIT */ | 9884 | #else /* not USE_X_TOOLKIT */ |
| 9877 | XSetLocaleModifiers (""); | 9885 | XSetLocaleModifiers (""); |
| 9886 | unrequest_sigio (); // See comment in x_display_ok. | ||
| 9878 | dpy = XOpenDisplay (SSDATA (display_name)); | 9887 | dpy = XOpenDisplay (SSDATA (display_name)); |
| 9888 | request_sigio (); | ||
| 9879 | #endif /* not USE_X_TOOLKIT */ | 9889 | #endif /* not USE_X_TOOLKIT */ |
| 9880 | #endif /* not USE_GTK*/ | 9890 | #endif /* not USE_GTK*/ |
| 9881 | 9891 | ||