X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/0f46bc7515ccc835e5752b47f8752ab7aaf7ed27..c2cbbdd1656a20cf979a11cbdd1d0a74e570772f:/src/xterm.c diff --git a/src/xterm.c b/src/xterm.c index 7e61cc4d8e..f0f6702cd6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ /* Xt features made by Fred Pierresteguy. */ #include -#include #include #include @@ -29,9 +28,6 @@ along with GNU Emacs. If not, see . */ #include "lisp.h" #include "blockinput.h" - -/* Need syssignal.h for various externs and definitions that may be required - by some configurations for calls to signal later in this source file. */ #include "syssignal.h" /* This may include sys/types.h, and that somehow loses @@ -165,13 +161,6 @@ struct x_display_info *x_display_list; Lisp_Object x_display_name_list; -/* Frame being updated by update_frame. This is declared in term.c. - This is set by update_begin and looked at by all the XT functions. - It is zero while not inside an update. In that case, the XT - functions assume that `selected_frame' is the frame to apply to. */ - -extern struct frame *updating_frame; - /* This is a frame waiting to be auto-raised, within XTread_socket. */ static struct frame *pending_autoraise_frame; @@ -1474,7 +1463,7 @@ x_frame_of_widget (Widget widget) && f->output_data.x->widget == widget) return f; - abort (); + emacs_abort (); } /* Allocate a color which is lighter or darker than *PIXEL by FACTOR @@ -2703,7 +2692,7 @@ x_draw_underwave (struct glyph_string *s) y2 += dy; if (INT_MAX - dx < xmax) - abort (); + emacs_abort (); while (x1 <= xmax) { @@ -2812,7 +2801,7 @@ x_draw_glyph_string (struct glyph_string *s) break; default: - abort (); + emacs_abort (); } if (!s->for_overlaps) @@ -3012,7 +3001,7 @@ x_shift_glyphs_for_insert (struct frame *f, int x, int y, int width, int height, static void x_delete_glyphs (struct frame *f, register int n) { - abort (); + emacs_abort (); } @@ -3285,7 +3274,7 @@ XTset_terminal_window (struct frame *f, int n) static void x_ins_del_lines (struct frame *f, int vpos, int n) { - abort (); + emacs_abort (); } @@ -4122,7 +4111,7 @@ x_window_to_scroll_bar (Display *display, Window window_id) frame = XCAR (tail); /* All elements of Vframe_list should be frames. */ if (! FRAMEP (frame)) - abort (); + emacs_abort (); if (! FRAME_X_P (XFRAME (frame))) continue; @@ -5441,7 +5430,7 @@ XTredeem_scroll_bar (struct window *window) /* We can't redeem this window's scroll bar if it doesn't have one. */ if (NILP (window->vertical_scroll_bar)) - abort (); + emacs_abort (); bar = XSCROLL_BAR (window->vertical_scroll_bar); @@ -5460,7 +5449,7 @@ XTredeem_scroll_bar (struct window *window) else /* If its prev pointer is nil, it must be at the front of one or the other! */ - abort (); + emacs_abort (); } else XSCROLL_BAR (bar->prev)->next = bar->next; @@ -5558,7 +5547,7 @@ static void x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_event *emacs_event) { if (! WINDOWP (bar->window)) - abort (); + emacs_abort (); emacs_event->kind = SCROLL_BAR_CLICK_EVENT; emacs_event->code = event->xbutton.button - Button1; @@ -6464,7 +6453,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, } else if (status_return != XLookupKeySym && status_return != XLookupBoth) - abort (); + emacs_abort (); } else nbytes = XLookupString (&event.xkey, (char *) copy_bufptr, @@ -7503,7 +7492,7 @@ x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int break; default: - abort (); + emacs_abort (); } } @@ -7773,7 +7762,9 @@ x_connection_signal (int signalnum) /* If we don't have an argument, */ #ifdef USG /* USG systems forget handlers when they are used; must reestablish each time */ - signal (signalnum, x_connection_signal); + struct sigaction action; + emacs_sigaction_init (&action, x_connection_signal); + sigaction (signalnum, &action, 0); #endif /* USG */ } @@ -7850,13 +7841,13 @@ x_connection_closed (Display *dpy, const char *error_message) (https://bugzilla.gnome.org/show_bug.cgi?id=85715). Once, the resulting Glib error message loop filled a user's disk. To avoid this, kill Emacs unconditionally on disconnect. */ - shut_down_emacs (0, 0, Qnil); + shut_down_emacs (0, Qnil); fprintf (stderr, "%s\n\ When compiled with GTK, Emacs cannot recover from X disconnects.\n\ This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\ For details, see etc/PROBLEMS.\n", error_msg); - abort (); + emacs_abort (); #endif /* USE_GTK */ /* Indicate that this display is dead. */ @@ -7866,7 +7857,7 @@ For details, see etc/PROBLEMS.\n", dpyinfo->terminal->reference_count--; if (dpyinfo->reference_count != 0) /* We have just closed all frames on this display. */ - abort (); + emacs_abort (); { Lisp_Object tmp; @@ -7883,10 +7874,15 @@ For details, see etc/PROBLEMS.\n", } /* Ordinary stack unwind doesn't deal with these. */ + { + sigset_t unblocked; + sigemptyset (&unblocked); #ifdef SIGIO - sigunblock (sigmask (SIGIO)); + sigaddset (&unblocked, SIGIO); #endif - sigunblock (sigmask (SIGALRM)); + sigaddset (&unblocked, SIGALRM); + pthread_sigmask (SIG_UNBLOCK, &unblocked, 0); + } TOTALLY_UNBLOCK_INPUT; unbind_to (idx, Qnil); @@ -10443,7 +10439,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) to.addr = (XPointer)&font; x_catch_errors (dpy); if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) - abort (); + emacs_abort (); if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); x_uncatch_errors (); @@ -10609,8 +10605,6 @@ x_activate_timeout_atimer (void) /* Set up use of X before we make the first connection. */ -extern frame_parm_handler x_frame_parm_handlers[]; - static struct redisplay_interface x_redisplay_interface = { x_frame_parm_handlers, @@ -10768,6 +10762,8 @@ x_create_terminal (struct x_display_info *dpyinfo) void x_initialize (void) { + struct sigaction action; + baud_rate = 19200; x_noop_count = 0; @@ -10814,7 +10810,8 @@ x_initialize (void) XSetErrorHandler (x_error_handler); XSetIOErrorHandler (x_io_error_quitter); - signal (SIGPIPE, x_connection_signal); + emacs_sigaction_init (&action, x_connection_signal); + sigaction (SIGPIPE, &action, 0); }