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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 18:36:26 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGac48b1885ad8: [Support] Change isatty to is_displayed (authored by dgg5503, committed by MaskRay).

Repository:
  rG LLVM Github Monorepo

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) && is_displayed())
     return 0;
   // Return the preferred block size.
   return statbuf.st_blksize;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75278.250671.patch
Type: text/x-patch
Size: 537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200317/3a722e03/attachment.bin>


More information about the llvm-commits mailing list