nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 731fd935ff7d555b462f25b9390f159350deb784
parent 0e1f7fe2ef1f9e8375a19b686754914f62af60d7
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat,  1 Aug 2020 11:34:23 +0200

feedback: add the reason to the error message when forking fails

This makes all the "Could not fork" messages the same again
after the change in commit 3eff34b0 from yesterday.

Diffstat:
Msrc/files.c | 2+-
Msrc/text.c | 5+++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -986,7 +986,7 @@ bool execute_command(const char *command) close(from_fd[1]); if (pid_of_command == -1) { - statusline(ALERT, _("Could not fork")); + statusline(ALERT, _("Could not fork: %s"), strerror(errno)); close(from_fd[0]); return FALSE; } diff --git a/src/text.c b/src/text.c @@ -2413,7 +2413,8 @@ const char *do_int_speller(const char *tempfile_name) /* When some child process was not forked successfully... */ if (pid_spell < 0 || pid_sort < 0 || pid_uniq < 0) { close(uniq_fd[0]); - return _("Could not fork"); + statusline(ALERT, _("Could not fork: %s"), strerror(errno)); + return NULL; } /* Get the system pipe buffer size. */ @@ -2644,7 +2645,7 @@ void do_linter(void) /* If the child process was not forked successfully... */ if (pid_lint < 0) { close(lint_fd[0]); - statusline(ALERT, _("Could not fork")); + statusline(ALERT, _("Could not fork: %s"), strerror(errno)); return; }