[PATCH] D75278: Use FileDescriptorIsDisplayed in place of direct call to isatty in support library

Douglas Gliner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 11:19:41 PDT 2020


dgg5503 updated this revision to Diff 249163.
dgg5503 added a comment.

Changed `sys::Process::FileDescriptorIsDisplayed(FD)` to `raw_fd_ostream::is_displayed()`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75278/new/

https://reviews.llvm.org/D75278

Files:
  llvm/lib/Support/raw_ostream.cpp


Index: llvm/lib/Support/raw_ostream.cpp
===================================================================
--- llvm/lib/Support/raw_ostream.cpp
+++ llvm/lib/Support/raw_ostream.cpp
@@ -792,7 +792,7 @@
   // 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) && raw_fd_ostream::is_displayed())
     return 0;
   // Return the preferred block size.
   return statbuf.st_blksize;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75278.249163.patch
Type: text/x-patch
Size: 553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200309/f398175b/attachment.bin>


More information about the llvm-commits mailing list