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 f1a09b39cf..f4117d67de 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/>. */
#include <sys/file.h>
#include <sys/time.h>
#include <unistd.h>
-#include <signal.h>
-#include <setjmp.h>
#include "lisp.h"
#include "termchar.h"
@@ -1498,7 +1496,7 @@ append_glyph (struct it *it)
{
glyph->resolved_level = it->bidi_it.resolved_level;
if ((it->bidi_it.type & 7) != it->bidi_it.type)
- abort ();
+ emacs_abort ();
glyph->bidi_type = it->bidi_it.type;
}
else
@@ -1695,7 +1693,7 @@ append_composite_glyph (struct it *it)
{
glyph->resolved_level = it->bidi_it.resolved_level;
if ((it->bidi_it.type & 7) != it->bidi_it.type)
- abort ();
+ emacs_abort ();
glyph->bidi_type = it->bidi_it.type;
}
else
@@ -1780,7 +1778,7 @@ append_glyphless_glyph (struct it *it, int face_id, const char *str)
{
glyph->resolved_level = it->bidi_it.resolved_level;
if ((it->bidi_it.type & 7) != it->bidi_it.type)
- abort ();
+ emacs_abort ();
glyph->bidi_type = it->bidi_it.type;
}
else
@@ -2250,7 +2248,7 @@ get_named_tty (const char *name)
struct terminal *t;
if (!name)
- abort ();
+ emacs_abort ();
for (t = terminal_list; t; t = t->next_terminal)
{
@@ -2798,7 +2796,7 @@ create_tty_output (struct frame *f)
struct tty_output *t = xzalloc (sizeof *t);
if (! FRAME_TERMCAP_P (f))
- abort ();
+ emacs_abort ();
t->display_info = FRAME_TERMINAL (f)->display_info.tty;
@@ -2811,7 +2809,7 @@ static void
tty_free_frame_resources (struct frame *f)
{
if (! FRAME_TERMCAP_P (f))
- abort ();
+ emacs_abort ();
if (FRAME_FACE_CACHE (f))
free_frame_faces (f);
@@ -2827,7 +2825,7 @@ static void
tty_free_frame_resources (struct frame *f)
{
if (! FRAME_TERMCAP_P (f) && ! FRAME_MSDOS_P (f))
- abort ();
+ emacs_abort ();
if (FRAME_FACE_CACHE (f))
free_frame_faces (f);
@@ -2932,7 +2930,10 @@ dissociate_if_controlling_tty (int fd)
no_controlling_tty = 1;
#else
#ifdef TIOCNOTTY /* Try BSD ioctls. */
- sigblock (sigmask (SIGTTOU));
+ sigset_t blocked;
+ sigemptyset (&blocked);
+ sigaddset (&blocked, SIGTTOU);
+ pthread_sigmask (SIG_BLOCK, &blocked, 0);
fd = emacs_open (DEV_TTY, O_RDWR, 0);
if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1)
{
@@ -2940,10 +2941,9 @@ dissociate_if_controlling_tty (int fd)
}
if (fd != -1)
emacs_close (fd);
- sigunblock (sigmask (SIGTTOU));
+ pthread_sigmask (SIG_UNBLOCK, &blocked, 0);
#else
- /* Unknown system. */
- croak ();
+# error "Unknown system."
#endif /* ! TIOCNOTTY */
#endif /* ! USG */
}
@@ -3074,9 +3074,14 @@ init_tty (const char *name, const char *terminal_type, int must_succeed)
/* On some systems, tgetent tries to access the controlling
terminal. */
- sigblock (sigmask (SIGTTOU));
- status = tgetent (tty->termcap_term_buffer, terminal_type);
- sigunblock (sigmask (SIGTTOU));
+ {
+ sigset_t blocked;
+ sigemptyset (&blocked);
+ sigaddset (&blocked, SIGTTOU);
+ pthread_sigmask (SIG_BLOCK, &blocked, 0);
+ status = tgetent (tty->termcap_term_buffer, terminal_type);
+ pthread_sigmask (SIG_UNBLOCK, &blocked, 0);
+ }
if (status < 0)
{
@@ -3108,7 +3113,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
#ifndef TERMINFO
if (strlen (tty->termcap_term_buffer) >= buffer_size)
- abort ();
+ emacs_abort ();
buffer_size = strlen (tty->termcap_term_buffer);
#endif
tty->termcap_strings_buffer = area = xmalloc (buffer_size);
@@ -3467,7 +3472,7 @@ maybe_fatal (int must_succeed, struct terminal *terminal,
verror (str1, ap);
va_end (ap);
- abort ();
+ emacs_abort ();
}
void
@@ -3494,7 +3499,7 @@ delete_tty (struct terminal *terminal)
return;
if (terminal->type != output_termcap)
- abort ();
+ emacs_abort ();
tty = terminal->display_info.tty;
@@ -3508,7 +3513,7 @@ delete_tty (struct terminal *terminal)
if (! p)
/* This should not happen. */
- abort ();
+ emacs_abort ();
p->next = tty->next;
tty->next = 0;