Commit 5b40bad6 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment