tweaks: rename a variable, to be more clear and to match another

master
Benno Schulenberg 2018-04-23 12:30:14 +02:00
parent 1e5064ef84
commit 0c613cb1ac
2 changed files with 6 additions and 6 deletions

View File

@ -1099,7 +1099,7 @@ bool scoop_stdin(void)
struct sigaction oldaction, newaction;
/* Original and temporary handlers for SIGINT. */
bool setup_failed = FALSE;
/* Whether setting up the SIGINT handler failed. */
/* Whether setting up the temporary SIGINT handler failed. */
FILE *stream;
int thetty;

View File

@ -1087,8 +1087,8 @@ bool execute_command(const char *command)
const char *shellenv;
struct sigaction oldaction, newaction;
/* Original and temporary handlers for SIGINT. */
bool sig_failed = FALSE;
/* Did sigaction() fail without changing the signal handlers? */
bool setup_failed = FALSE;
/* Whether setting up the temporary SIGINT handler failed. */
/* Make our pipes. */
if (pipe(fd) == -1) {
@ -1128,12 +1128,12 @@ bool execute_command(const char *command)
/* Set things up so that Ctrl-C will terminate the forked process. */
if (sigaction(SIGINT, NULL, &newaction) == -1) {
sig_failed = TRUE;
setup_failed = TRUE;
nperror("sigaction");
} else {
newaction.sa_handler = cancel_command;
if (sigaction(SIGINT, &newaction, &oldaction) == -1) {
sig_failed = TRUE;
setup_failed = TRUE;
nperror("sigaction");
}
}
@ -1148,7 +1148,7 @@ bool execute_command(const char *command)
nperror("wait");
/* If it was changed, restore the handler for SIGINT. */
if (!sig_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
if (!setup_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
nperror("sigaction");
/* Restore the terminal to its desired state, and disable