tweaks: group the closing of two descriptors, and reword two comments
parent
302ea79d1c
commit
90d4b51837
13
src/text.c
13
src/text.c
|
@ -2733,18 +2733,15 @@ void do_linter(void)
|
||||||
|
|
||||||
construct_argument_list(&lintargs, openfile->syntax->linter, openfile->filename);
|
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) {
|
if ((pid_lint = fork()) == 0) {
|
||||||
|
/* Redirect standard output and standard error into the pipe. */
|
||||||
/* Child continues here (i.e. the future linting process). */
|
|
||||||
close(lint_fd[0]);
|
|
||||||
|
|
||||||
/* Send the linter's standard output + err to the pipe. */
|
|
||||||
if (dup2(lint_fd[1], STDOUT_FILENO) != STDOUT_FILENO)
|
if (dup2(lint_fd[1], STDOUT_FILENO) != STDOUT_FILENO)
|
||||||
exit(9);
|
exit(7);
|
||||||
if (dup2(lint_fd[1], STDERR_FILENO) != STDERR_FILENO)
|
if (dup2(lint_fd[1], STDERR_FILENO) != STDERR_FILENO)
|
||||||
exit(9);
|
exit(8);
|
||||||
|
|
||||||
|
close(lint_fd[0]);
|
||||||
close(lint_fd[1]);
|
close(lint_fd[1]);
|
||||||
|
|
||||||
/* Start the linter program; we are using $PATH. */
|
/* Start the linter program; we are using $PATH. */
|
||||||
|
|
Loading…
Reference in New Issue