Mercurial > vim
comparison src/os_unix.c @ 9074:3aab62b76363 v7.4.1822
commit https://github.com/vim/vim/commit/ea83bf06b92baeb6d68a10d8e8ffad289d31dae2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 8 09:40:51 2016 +0200
patch 7.4.1822
Problem: Redirecting stdout of a channel to "null" doesn't work. (Nicola)
Solution: Correct the file descriptor number.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 08 May 2016 09:45:04 +0200 |
parents | 149d976650a1 |
children | 4b55d8e162d4 |
comparison
equal
deleted
inserted
replaced
9073:b7678a70b23e | 9074:3aab62b76363 |
---|---|
5193 } | 5193 } |
5194 | 5194 |
5195 /* set up stdout for the child */ | 5195 /* set up stdout for the child */ |
5196 if (use_null_for_out && null_fd >= 0) | 5196 if (use_null_for_out && null_fd >= 0) |
5197 { | 5197 { |
5198 close(0); | 5198 close(1); |
5199 ignored = dup(null_fd); | 5199 ignored = dup(null_fd); |
5200 } | 5200 } |
5201 else | 5201 else |
5202 { | 5202 { |
5203 if (!use_file_for_out) | 5203 if (!use_file_for_out) |
5204 close(fd_out[0]); | 5204 close(fd_out[0]); |
5205 close(1); | 5205 close(1); |
5206 ignored = dup(fd_out[1]); | 5206 ignored = dup(fd_out[1]); |
5207 close(fd_out[1]); | 5207 close(fd_out[1]); |
5208 } | 5208 } |
5209 | |
5209 if (null_fd >= 0) | 5210 if (null_fd >= 0) |
5210 close(null_fd); | 5211 close(null_fd); |
5211 | 5212 |
5212 /* See above for type of argv. */ | 5213 /* See above for type of argv. */ |
5213 execvp(argv[0], argv); | 5214 execvp(argv[0], argv); |