aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/term.c b/src/term.c
index f1a09b39cf9..f4117d67dec 100644
--- a/src/term.c
+++ b/src/term.c
@@ -25,8 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include <sys/file.h> 25#include <sys/file.h>
26#include <sys/time.h> 26#include <sys/time.h>
27#include <unistd.h> 27#include <unistd.h>
28#include <signal.h>
29#include <setjmp.h>
30 28
31#include "lisp.h" 29#include "lisp.h"
32#include "termchar.h" 30#include "termchar.h"
@@ -1498,7 +1496,7 @@ append_glyph (struct it *it)
1498 { 1496 {
1499 glyph->resolved_level = it->bidi_it.resolved_level; 1497 glyph->resolved_level = it->bidi_it.resolved_level;
1500 if ((it->bidi_it.type & 7) != it->bidi_it.type) 1498 if ((it->bidi_it.type & 7) != it->bidi_it.type)
1501 abort (); 1499 emacs_abort ();
1502 glyph->bidi_type = it->bidi_it.type; 1500 glyph->bidi_type = it->bidi_it.type;
1503 } 1501 }
1504 else 1502 else
@@ -1695,7 +1693,7 @@ append_composite_glyph (struct it *it)
1695 { 1693 {
1696 glyph->resolved_level = it->bidi_it.resolved_level; 1694 glyph->resolved_level = it->bidi_it.resolved_level;
1697 if ((it->bidi_it.type & 7) != it->bidi_it.type) 1695 if ((it->bidi_it.type & 7) != it->bidi_it.type)
1698 abort (); 1696 emacs_abort ();
1699 glyph->bidi_type = it->bidi_it.type; 1697 glyph->bidi_type = it->bidi_it.type;
1700 } 1698 }
1701 else 1699 else
@@ -1780,7 +1778,7 @@ append_glyphless_glyph (struct it *it, int face_id, const char *str)
1780 { 1778 {
1781 glyph->resolved_level = it->bidi_it.resolved_level; 1779 glyph->resolved_level = it->bidi_it.resolved_level;
1782 if ((it->bidi_it.type & 7) != it->bidi_it.type) 1780 if ((it->bidi_it.type & 7) != it->bidi_it.type)
1783 abort (); 1781 emacs_abort ();
1784 glyph->bidi_type = it->bidi_it.type; 1782 glyph->bidi_type = it->bidi_it.type;
1785 } 1783 }
1786 else 1784 else
@@ -2250,7 +2248,7 @@ get_named_tty (const char *name)
2250 struct terminal *t; 2248 struct terminal *t;
2251 2249
2252 if (!name) 2250 if (!name)
2253 abort (); 2251 emacs_abort ();
2254 2252
2255 for (t = terminal_list; t; t = t->next_terminal) 2253 for (t = terminal_list; t; t = t->next_terminal)
2256 { 2254 {
@@ -2798,7 +2796,7 @@ create_tty_output (struct frame *f)
2798 struct tty_output *t = xzalloc (sizeof *t); 2796 struct tty_output *t = xzalloc (sizeof *t);
2799 2797
2800 if (! FRAME_TERMCAP_P (f)) 2798 if (! FRAME_TERMCAP_P (f))
2801 abort (); 2799 emacs_abort ();
2802 2800
2803 t->display_info = FRAME_TERMINAL (f)->display_info.tty; 2801 t->display_info = FRAME_TERMINAL (f)->display_info.tty;
2804 2802
@@ -2811,7 +2809,7 @@ static void
2811tty_free_frame_resources (struct frame *f) 2809tty_free_frame_resources (struct frame *f)
2812{ 2810{
2813 if (! FRAME_TERMCAP_P (f)) 2811 if (! FRAME_TERMCAP_P (f))
2814 abort (); 2812 emacs_abort ();
2815 2813
2816 if (FRAME_FACE_CACHE (f)) 2814 if (FRAME_FACE_CACHE (f))
2817 free_frame_faces (f); 2815 free_frame_faces (f);
@@ -2827,7 +2825,7 @@ static void
2827tty_free_frame_resources (struct frame *f) 2825tty_free_frame_resources (struct frame *f)
2828{ 2826{
2829 if (! FRAME_TERMCAP_P (f) && ! FRAME_MSDOS_P (f)) 2827 if (! FRAME_TERMCAP_P (f) && ! FRAME_MSDOS_P (f))
2830 abort (); 2828 emacs_abort ();
2831 2829
2832 if (FRAME_FACE_CACHE (f)) 2830 if (FRAME_FACE_CACHE (f))
2833 free_frame_faces (f); 2831 free_frame_faces (f);
@@ -2932,7 +2930,10 @@ dissociate_if_controlling_tty (int fd)
2932 no_controlling_tty = 1; 2930 no_controlling_tty = 1;
2933#else 2931#else
2934#ifdef TIOCNOTTY /* Try BSD ioctls. */ 2932#ifdef TIOCNOTTY /* Try BSD ioctls. */
2935 sigblock (sigmask (SIGTTOU)); 2933 sigset_t blocked;
2934 sigemptyset (&blocked);
2935 sigaddset (&blocked, SIGTTOU);
2936 pthread_sigmask (SIG_BLOCK, &blocked, 0);
2936 fd = emacs_open (DEV_TTY, O_RDWR, 0); 2937 fd = emacs_open (DEV_TTY, O_RDWR, 0);
2937 if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1) 2938 if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1)
2938 { 2939 {
@@ -2940,10 +2941,9 @@ dissociate_if_controlling_tty (int fd)
2940 } 2941 }
2941 if (fd != -1) 2942 if (fd != -1)
2942 emacs_close (fd); 2943 emacs_close (fd);
2943 sigunblock (sigmask (SIGTTOU)); 2944 pthread_sigmask (SIG_UNBLOCK, &blocked, 0);
2944#else 2945#else
2945 /* Unknown system. */ 2946# error "Unknown system."
2946 croak ();
2947#endif /* ! TIOCNOTTY */ 2947#endif /* ! TIOCNOTTY */
2948#endif /* ! USG */ 2948#endif /* ! USG */
2949 } 2949 }
@@ -3074,9 +3074,14 @@ init_tty (const char *name, const char *terminal_type, int must_succeed)
3074 3074
3075 /* On some systems, tgetent tries to access the controlling 3075 /* On some systems, tgetent tries to access the controlling
3076 terminal. */ 3076 terminal. */
3077 sigblock (sigmask (SIGTTOU)); 3077 {
3078 status = tgetent (tty->termcap_term_buffer, terminal_type); 3078 sigset_t blocked;
3079 sigunblock (sigmask (SIGTTOU)); 3079 sigemptyset (&blocked);
3080 sigaddset (&blocked, SIGTTOU);
3081 pthread_sigmask (SIG_BLOCK, &blocked, 0);
3082 status = tgetent (tty->termcap_term_buffer, terminal_type);
3083 pthread_sigmask (SIG_UNBLOCK, &blocked, 0);
3084 }
3080 3085
3081 if (status < 0) 3086 if (status < 0)
3082 { 3087 {
@@ -3108,7 +3113,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3108 3113
3109#ifndef TERMINFO 3114#ifndef TERMINFO
3110 if (strlen (tty->termcap_term_buffer) >= buffer_size) 3115 if (strlen (tty->termcap_term_buffer) >= buffer_size)
3111 abort (); 3116 emacs_abort ();
3112 buffer_size = strlen (tty->termcap_term_buffer); 3117 buffer_size = strlen (tty->termcap_term_buffer);
3113#endif 3118#endif
3114 tty->termcap_strings_buffer = area = xmalloc (buffer_size); 3119 tty->termcap_strings_buffer = area = xmalloc (buffer_size);
@@ -3467,7 +3472,7 @@ maybe_fatal (int must_succeed, struct terminal *terminal,
3467 verror (str1, ap); 3472 verror (str1, ap);
3468 3473
3469 va_end (ap); 3474 va_end (ap);
3470 abort (); 3475 emacs_abort ();
3471} 3476}
3472 3477
3473void 3478void
@@ -3494,7 +3499,7 @@ delete_tty (struct terminal *terminal)
3494 return; 3499 return;
3495 3500
3496 if (terminal->type != output_termcap) 3501 if (terminal->type != output_termcap)
3497 abort (); 3502 emacs_abort ();
3498 3503
3499 tty = terminal->display_info.tty; 3504 tty = terminal->display_info.tty;
3500 3505
@@ -3508,7 +3513,7 @@ delete_tty (struct terminal *terminal)
3508 3513
3509 if (! p) 3514 if (! p)
3510 /* This should not happen. */ 3515 /* This should not happen. */
3511 abort (); 3516 emacs_abort ();
3512 3517
3513 p->next = tty->next; 3518 p->next = tty->next;
3514 tty->next = 0; 3519 tty->next = 0;