mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
libr/cons: Fix SIGWINCH logic (#11470)
Fixes two bugs; puts pselect in a loop to enable resizing window more than once before there is any input, and reset sigwinchFlag to zero when resizing window.
This commit is contained in:
parent
7f816f53db
commit
2b7990fcee
@ -502,9 +502,11 @@ R_API int r_cons_readchar() {
|
||||
FD_SET (STDIN_FILENO, &readfds);
|
||||
r_signal_sigmask (0, NULL, &sigmask);
|
||||
sigdelset (&sigmask, SIGWINCH);
|
||||
pselect (STDIN_FILENO + 1, &readfds, NULL, NULL, NULL, &sigmask);
|
||||
if (sigwinchFlag != 0) {
|
||||
resizeWin ();
|
||||
while (pselect (STDIN_FILENO + 1, &readfds, NULL, NULL, NULL, &sigmask) == -1) {
|
||||
if (sigwinchFlag) {
|
||||
sigwinchFlag = 0;
|
||||
resizeWin ();
|
||||
}
|
||||
}
|
||||
|
||||
ssize_t ret = read (STDIN_FILENO, buf, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user