1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

[Support] Change isatty to is_displayed

Currently, when building with the Unix support library and `isatty` does
not exist for the target platform (i.e. `HAVE_ISATTY` is false),
compilation of the file `raw_ostream.cpp` will fail due to direct use of
`isatty` in the function `raw_fd_ostream::preferred_buffer_size()`.

Use is_displayed() to fix the problem.

Reviewed By: probinson, MaskRay

Differential Revision: https://reviews.llvm.org/D75278
This commit is contained in:
Douglas Gliner 2020-03-16 18:20:58 -07:00 committed by Fangrui Song
parent 3239d36846
commit 5b4bd08141

View File

@ -792,7 +792,7 @@ size_t raw_fd_ostream::preferred_buffer_size() const {
// If this is a terminal, don't use buffering. Line buffering
// would be a more traditional thing to do, but it's not worth
// the complexity.
if (S_ISCHR(statbuf.st_mode) && isatty(FD))
if (S_ISCHR(statbuf.st_mode) && is_displayed())
return 0;
// Return the preferred block size.
return statbuf.st_blksize;