feedback: when creating a pipe fails, report also the reason

After commit 59bbc0b8 from five days ago (that made a divergent pipe
failure to be treated in the same way as the other two), this became
possible without having two different pipe-failure messages.
This commit is contained in:
Benno Schulenberg 2020-08-06 08:40:17 +02:00
parent 4c63ef204d
commit d7c2b98ead
2 changed files with 3 additions and 3 deletions

View File

@ -951,7 +951,7 @@ bool execute_command(const char *command)
/* Create a pipe to read the command's output from, and, if needed,
* a pipe to feed the command's input through. */
if (pipe(from_fd) == -1 || (should_pipe && pipe(to_fd) == -1)) {
statusline(ALERT, _("Could not create pipe"));
statusline(ALERT, _("Could not create pipe: %s"), strerror(errno));
return FALSE;
}

View File

@ -2340,7 +2340,7 @@ void do_int_speller(const char *tempfile_name)
/* Create all three pipes up front. */
if (pipe(spell_fd) == -1 || pipe(sort_fd) == -1 || pipe(uniq_fd) == -1) {
statusline(ALERT, _("Could not create pipe"));
statusline(ALERT, _("Could not create pipe: %s"), strerror(errno));
return;
}
@ -2607,7 +2607,7 @@ void do_linter(void)
/* Create a pipe up front. */
if (pipe(lint_fd) == -1) {
statusline(ALERT, _("Could not create pipe"));
statusline(ALERT, _("Could not create pipe: %s"), strerror(errno));
return;
}