aboutsummaryrefslogtreecommitdiff
path: root/readline
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2008-03-24 12:59:51 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2008-03-24 12:59:51 +0000
commit87adec2ec1241052deb5cacb93b463c05176fafb (patch)
tree158e85804ce27d553574dabfce22c7c5c85c46a1 /readline
parent086a18414ad6c07d0ee79990a971fdc7387af7c1 (diff)
downloadgdb-87adec2ec1241052deb5cacb93b463c05176fafb.zip
gdb-87adec2ec1241052deb5cacb93b463c05176fafb.tar.gz
gdb-87adec2ec1241052deb5cacb93b463c05176fafb.tar.bz2
PR gdb/544
* rltty.c (block_sigint, release_sigint): Rename to... (_rl_block_sigint, _rl_release_sigint): ...these and make them global. * rltty.h (_rl_block_sigint, _rl_release_sigint): New prototypes. * display.c (rl_redisplay): Wrap the function by the calls to _RL_BLOCK_SIGINT and _RL_RELEASE_SIGINT.
Diffstat (limited to 'readline')
-rw-r--r--readline/ChangeLog.gdb9
-rw-r--r--readline/display.c6
-rw-r--r--readline/rltty.c28
-rw-r--r--readline/rltty.h3
4 files changed, 32 insertions, 14 deletions
diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb
index 0c3bcc4..1a1dfc9 100644
--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,3 +1,12 @@
+2008-03-24 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ PR gdb/544
+ * rltty.c (block_sigint, release_sigint): Rename to...
+ (_rl_block_sigint, _rl_release_sigint): ...these and make them global.
+ * rltty.h (_rl_block_sigint, _rl_release_sigint): New prototypes.
+ * display.c (rl_redisplay): Wrap the function by the calls to
+ _RL_BLOCK_SIGINT and _RL_RELEASE_SIGINT.
+
2007-09-01 Daniel Jacobowitz <dan@codesourcery.com>
PR gdb/2138
diff --git a/readline/display.c b/readline/display.c
index 0858098..575b0ad 100644
--- a/readline/display.c
+++ b/readline/display.c
@@ -463,6 +463,10 @@ rl_redisplay ()
if (!readline_echoing_p)
return;
+ /* Signals are blocked through this function as the global data structures
+ could get corrupted upon modifications from an invoked signal handler. */
+ _rl_block_sigint ();
+
if (!rl_display_prompt)
rl_display_prompt = "";
@@ -1139,6 +1143,8 @@ rl_redisplay ()
else
visible_wrap_offset = wrap_offset;
}
+
+ _rl_release_sigint ();
}
/* PWP: update_line() is based on finding the middle difference of each
diff --git a/readline/rltty.c b/readline/rltty.c
index 9a0326e..0cd5028 100644
--- a/readline/rltty.c
+++ b/readline/rltty.c
@@ -52,8 +52,8 @@ extern int errno;
rl_vintfunc_t *rl_prep_term_function = rl_prep_terminal;
rl_voidfunc_t *rl_deprep_term_function = rl_deprep_terminal;
-static void block_sigint PARAMS((void));
-static void release_sigint PARAMS((void));
+void _rl_block_sigint PARAMS((void));
+void _rl_release_sigint PARAMS((void));
static void set_winsize PARAMS((int));
@@ -74,9 +74,9 @@ static int sigint_oldmask;
static int sigint_blocked;
/* Cause SIGINT to not be delivered until the corresponding call to
- release_sigint(). */
-static void
-block_sigint ()
+ _rl_release_sigint(). */
+void
+_rl_block_sigint ()
{
if (sigint_blocked)
return;
@@ -100,8 +100,8 @@ block_sigint ()
}
/* Allow SIGINT to be delivered. */
-static void
-release_sigint ()
+void
+_rl_release_sigint ()
{
if (sigint_blocked == 0)
return;
@@ -663,7 +663,7 @@ rl_prep_terminal (meta_flag)
return;
/* Try to keep this function from being INTerrupted. */
- block_sigint ();
+ _rl_block_sigint ();
tty = fileno (rl_instream);
@@ -676,7 +676,7 @@ rl_prep_terminal (meta_flag)
if (errno == ENOTTY)
#endif
readline_echoing_p = 1; /* XXX */
- release_sigint ();
+ _rl_release_sigint ();
return;
}
@@ -711,7 +711,7 @@ rl_prep_terminal (meta_flag)
if (set_tty_settings (tty, &tio) < 0)
{
- release_sigint ();
+ _rl_release_sigint ();
return;
}
@@ -722,7 +722,7 @@ rl_prep_terminal (meta_flag)
terminal_prepped = 1;
RL_SETSTATE(RL_STATE_TERMPREPPED);
- release_sigint ();
+ _rl_release_sigint ();
}
/* Restore the terminal's normal settings and modes. */
@@ -735,7 +735,7 @@ rl_deprep_terminal ()
return;
/* Try to keep this function from being interrupted. */
- block_sigint ();
+ _rl_block_sigint ();
tty = fileno (rl_instream);
@@ -746,14 +746,14 @@ rl_deprep_terminal ()
if (set_tty_settings (tty, &otio) < 0)
{
- release_sigint ();
+ _rl_release_sigint ();
return;
}
terminal_prepped = 0;
RL_UNSETSTATE(RL_STATE_TERMPREPPED);
- release_sigint ();
+ _rl_release_sigint ();
}
#endif /* !NO_TTY_DRIVER */
diff --git a/readline/rltty.h b/readline/rltty.h
index 142e96b..fc6662d 100644
--- a/readline/rltty.h
+++ b/readline/rltty.h
@@ -79,4 +79,7 @@ typedef struct _rl_tty_chars {
unsigned char t_status;
} _RL_TTY_CHARS;
+extern void _rl_block_sigint PARAMS((void));
+extern void _rl_release_sigint PARAMS((void));
+
#endif /* _RLTTY_H_ */