Specify SA_RESTART when registering the SIGWINCH signal handler
authorPatrick Palka <patrick@parcs.ath.cx>
Sat, 30 Aug 2014 19:33:08 +0000 (15:33 -0400)
committerJoel Brobecker <brobecker@adacore.com>
Sun, 23 Nov 2014 10:12:05 +0000 (14:12 +0400)
SA_RESTART allows system calls to be restarted across a signal handler.
By specifying this flag we fix the issue where if the user is being
prompted to answer yes or no, and the terminal gets resized in the
meantime, the prompt will think that the user sent an EOF and so it will
take the default action for that prompt (in the case of the quit prompt,
it will quit GDB).

gdb/ChangeLog:

* tui/tui-win.c (tui_initialize_win): Specify SA_RESTART when
registering the signal handler.

gdb/ChangeLog
gdb/tui/tui-win.c

index 326a0d67e998b7807db99dc4c7ca071dd89b6b7f..45435fc1b17b44a25028b81260a1db5515d1b8af 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-23  Patrick Palka  <patrick@parcs.ath.cx>
+
+       * tui/tui-win.c (tui_initialize_win): Specify SA_RESTART when
+       registering the signal handler.
+
 2014-11-23  Patrick Palka  <patrick@parcs.ath.cx>
 
        * event-top.h (call_stdin_event_handler_again_p): Declare.
index d17a1e4741c8bbe4ffe520c57804d64f02e8dcd6..4488da83b667dbcef386c46587a2d27f301a4926 100644 (file)
@@ -834,6 +834,9 @@ tui_initialize_win (void)
 
   memset (&old_winch, 0, sizeof (old_winch));
   old_winch.sa_handler = &tui_sigwinch_handler;
+#ifdef SA_RESTART
+  old_winch.sa_flags = SA_RESTART;
+#endif
   sigaction (SIGWINCH, &old_winch, NULL);
 #else
   signal (SIGWINCH, &tui_sigwinch_handler);
This page took 0.030445 seconds and 4 git commands to generate.