aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-win.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-10-02 16:50:08 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-10-02 16:50:08 +0000
commit9612b5ec136fc465a91c191be08b37060bb18e2f (patch)
tree995495b1de699b012352fd0dcc0bdd1f06824890 /gdb/tui/tui-win.c
parent407f1a2e1727b611f2f36645b23300b4f15cf402 (diff)
downloadgdb-9612b5ec136fc465a91c191be08b37060bb18e2f.zip
gdb-9612b5ec136fc465a91c191be08b37060bb18e2f.tar.gz
gdb-9612b5ec136fc465a91c191be08b37060bb18e2f.tar.bz2
2007-10-02 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
* tui/tui-interp.c (tui_init): Initialize tui's SIGWINCH signal handler. * tui/tui-win.c (tui_initialize_win): New function for initializing tui's SIGWINCH signal handler. * tui/tui-win.h (tui_initialize_win): Declare.
Diffstat (limited to 'gdb/tui/tui-win.c')
-rw-r--r--gdb/tui/tui-win.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index d90bb05..aea6b3e 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -50,6 +50,8 @@
#include <ctype.h>
#include "readline/readline.h"
+#include <signal.h>
+
/*******************************
** Static Local Decls
********************************/
@@ -813,6 +815,21 @@ tui_sigwinch_handler (int signal)
tui_set_win_resized_to (TRUE);
}
+/* Initializes SIGWINCH signal handler for the tui. */
+void
+tui_initialize_win (void)
+{
+#ifdef SIGWINCH
+#ifdef HAVE_SIGACTION
+ struct sigaction old_winch;
+ memset (&old_winch, 0, sizeof (old_winch));
+ old_winch.sa_handler = &tui_sigwinch_handler;
+ sigaction (SIGWINCH, &old_winch, NULL);
+#else
+ signal (SIGWINCH, &tui_sigwinch_handler);
+#endif
+#endif
+}
/*************************