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
Benno Schulenberg 2018-04-23 11:58:18 +02:00
parent 45f8fc77e0
commit 5b40bad629
1 changed files with 3 additions and 3 deletions

View File

@ -1118,12 +1118,12 @@ bool scoop_stdin(void)
/* Set things up so that SIGINT will cancel the reading. */
if (sigaction(SIGINT, NULL, &newaction) == -1) {
setup_failed = TRUE;
nperror("sigaction");
perror("sigaction");
} else {
newaction.sa_handler = make_a_note;
if (sigaction(SIGINT, &newaction, &oldaction) == -1) {
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 (!setup_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
nperror("sigaction");
perror("sigaction");
terminal_init();
doupdate();