From 90d4b51837895d955a718b766d591baaff4d2d88 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 17 Nov 2019 08:15:02 +0100 Subject: [PATCH] tweaks: group the closing of two descriptors, and reword two comments --- src/text.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/text.c b/src/text.c index fddb871d..2aa4e1cf 100644 --- a/src/text.c +++ b/src/text.c @@ -2733,18 +2733,15 @@ void do_linter(void) construct_argument_list(&lintargs, openfile->syntax->linter, openfile->filename); - /* Start a new process to run the linter in. */ + /* Fork a process to run the linter in. */ if ((pid_lint = fork()) == 0) { - - /* Child continues here (i.e. the future linting process). */ - close(lint_fd[0]); - - /* Send the linter's standard output + err to the pipe. */ + /* Redirect standard output and standard error into the pipe. */ if (dup2(lint_fd[1], STDOUT_FILENO) != STDOUT_FILENO) - exit(9); + exit(7); if (dup2(lint_fd[1], STDERR_FILENO) != STDERR_FILENO) - exit(9); + exit(8); + close(lint_fd[0]); close(lint_fd[1]); /* Start the linter program; we are using $PATH. */