files: prevent a hang when a call to sigaction() would fail
Don't try to re-enter curses mode when the terminal is not in the correct state yet. This fixes https://savannah.gnu.org/bugs/?53720.master
parent
45f8fc77e0
commit
5b40bad629
|
@ -1118,12 +1118,12 @@ bool scoop_stdin(void)
|
||||||
/* Set things up so that SIGINT will cancel the reading. */
|
/* Set things up so that SIGINT will cancel the reading. */
|
||||||
if (sigaction(SIGINT, NULL, &newaction) == -1) {
|
if (sigaction(SIGINT, NULL, &newaction) == -1) {
|
||||||
setup_failed = TRUE;
|
setup_failed = TRUE;
|
||||||
nperror("sigaction");
|
perror("sigaction");
|
||||||
} else {
|
} else {
|
||||||
newaction.sa_handler = make_a_note;
|
newaction.sa_handler = make_a_note;
|
||||||
if (sigaction(SIGINT, &newaction, &oldaction) == -1) {
|
if (sigaction(SIGINT, &newaction, &oldaction) == -1) {
|
||||||
setup_failed = TRUE;
|
setup_failed = TRUE;
|
||||||
nperror("sigaction");
|
perror("sigaction");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1156,7 +1156,7 @@ bool scoop_stdin(void)
|
||||||
|
|
||||||
/* If it was changed, restore the handler for SIGINT. */
|
/* If it was changed, restore the handler for SIGINT. */
|
||||||
if (!setup_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
|
if (!setup_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
|
||||||
nperror("sigaction");
|
perror("sigaction");
|
||||||
|
|
||||||
terminal_init();
|
terminal_init();
|
||||||
doupdate();
|
doupdate();
|
||||||
|
|
Loading…
Reference in New Issue