commit 90d4b51837895d955a718b766d591baaff4d2d88
parent 302ea79d1cea43720c008d4d8c217baa78b3bc00
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 17 Nov 2019 08:15:02 +0100
tweaks: group the closing of two descriptors, and reword two comments
Diffstat:
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git 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. */