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