Replace explicit uv_guest_handle(fd) == UV_TTY by os_isatty

This commit is contained in:
Pavel Platto 2014-04-17 08:55:34 +03:00 committed by Thiago de Arruda
parent aea2e2cb12
commit 61b7b2d81a

View File

@ -167,7 +167,7 @@ static void read_cb(RStream *rstream, void *data, bool at_eof)
if (at_eof) {
if (!started_reading
&& rstream_is_regular_file(rstream)
&& uv_guess_handle(2) == UV_TTY) {
&& os_isatty(STDERR_FILENO)) {
// Read error. Since stderr is a tty we switch to reading from it. This
// is for handling for cases like "foo | xargs vim" because xargs
// redirects stdin from /dev/null. Previously, this was done in ui.c