tweaks: group the closing of two descriptors, and reword two comments

master
Benno Schulenberg 2019-11-17 08:15:02 +01:00
parent 302ea79d1c
commit 90d4b51837
1 changed files with 5 additions and 8 deletions

View File

@ -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. */