diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2015-04-27 21:37:48 -0400 |
---|---|---|
committer | Patrick Palka <patrick@parcs.ath.cx> | 2015-05-13 11:53:28 -0400 |
commit | 1e04046d0b7e0f87bc6e2fefd966c9dd89d2ce13 (patch) | |
tree | fec0ac237bd87cc93603dc18cad9fac8704fcd7e /gdb/tui/tui.c | |
parent | 558e5469679897ee57ad6706074f55ff4952cf43 (diff) | |
download | binutils-1e04046d0b7e0f87bc6e2fefd966c9dd89d2ce13.zip binutils-1e04046d0b7e0f87bc6e2fefd966c9dd89d2ce13.tar.gz binutils-1e04046d0b7e0f87bc6e2fefd966c9dd89d2ce13.tar.bz2 |
Avoid race condition when handling a SIGWINCH signal
The control variable win_resized must be cleared before responding to
it.
Otherwise there is a small window where another SIGWINCH might occur in
between the handling of an earlier SIGWINCH and the clearing of
win_resized, at which point win_resized would be set (again) by the
signal handler. Shortly thereafter we would clear win_resized even
though we only handled the earlier SIGWINCH but not the latest one.
This chain of events is all avoided if we clear win_resized first.
gdb/ChangeLog:
* tui/tui-win.c (tui_async_resize_screen): Clear win_resized
first before resizing the window.
* tui.c (tui_enable): Likewise.
Diffstat (limited to 'gdb/tui/tui.c')
-rw-r--r-- | gdb/tui/tui.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 9fac06e..b04e106 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -492,8 +492,8 @@ tui_enable (void) window. */ if (tui_win_resized ()) { - tui_resize_all (); tui_set_win_resized_to (FALSE); + tui_resize_all (); } if (deprecated_safe_get_selected_frame ()) |