tweaks: elide an unused return value
The execute_command() function — then called open_pipe() — was changed to have a boolean return value in commit ce62e82a eighteen years ago, but the value has never been used or checked.
This commit is contained in:
parent
35cde9f8d7
commit
1ae10b1487
12
src/files.c
12
src/files.c
@ -1002,8 +1002,8 @@ void send_data(const linestruct *line, int fd)
|
|||||||
fclose(tube);
|
fclose(tube);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Execute the given command in a shell. Return TRUE on success. */
|
/* Execute the given command in a shell. */
|
||||||
bool execute_command(const char *command)
|
void execute_command(const char *command)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAIT)
|
#if defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAIT)
|
||||||
int from_fd[2], to_fd[2];
|
int from_fd[2], to_fd[2];
|
||||||
@ -1018,7 +1018,7 @@ bool execute_command(const char *command)
|
|||||||
* a pipe to feed the command's input through. */
|
* a pipe to feed the command's input through. */
|
||||||
if (pipe(from_fd) == -1 || (should_pipe && pipe(to_fd) == -1)) {
|
if (pipe(from_fd) == -1 || (should_pipe && pipe(to_fd) == -1)) {
|
||||||
statusline(ALERT, _("Could not create pipe: %s"), strerror(errno));
|
statusline(ALERT, _("Could not create pipe: %s"), strerror(errno));
|
||||||
return FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fork a child process to run the command in. */
|
/* Fork a child process to run the command in. */
|
||||||
@ -1059,7 +1059,7 @@ bool execute_command(const char *command)
|
|||||||
if (pid_of_command == -1) {
|
if (pid_of_command == -1) {
|
||||||
statusline(ALERT, _("Could not fork: %s"), strerror(errno));
|
statusline(ALERT, _("Could not fork: %s"), strerror(errno));
|
||||||
close(from_fd[0]);
|
close(from_fd[0]);
|
||||||
return FALSE;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
statusbar(_("Executing..."));
|
statusbar(_("Executing..."));
|
||||||
@ -1143,10 +1143,6 @@ bool execute_command(const char *command)
|
|||||||
/* Restore the terminal to its desired state, and disable
|
/* Restore the terminal to its desired state, and disable
|
||||||
* interpretation of the special control keys again. */
|
* interpretation of the special control keys again. */
|
||||||
terminal_init();
|
terminal_init();
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
#else
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* NANO_TINY */
|
#endif /* NANO_TINY */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user