From Roman Zulak: Flush stdout less (cling).
This commit is contained in:
parent
1aabc2dbe0
commit
43fe0be0a0
@ -46,13 +46,11 @@ namespace cling {
|
||||
class MetaProcessor::RedirectOutput {
|
||||
|
||||
static int dupOnce(int Fd, int& Bak) {
|
||||
#ifdef LLVM_ON_WIN32
|
||||
// Possibly because Windows isn't really Posix, we need to flush
|
||||
// now or can drop the buffer when dup2 is called with Fd later.
|
||||
// Flush now or can drop the buffer when dup2 is called with Fd later.
|
||||
// This seems only neccessary when piping stdout or stderr, but do it
|
||||
// for ttys to avoid over complicated code for minimal benefit.
|
||||
::fflush(Fd==STDOUT_FILENO ? stdout : stderr);
|
||||
#endif
|
||||
|
||||
if (Bak == kInvalidFD)
|
||||
Bak = ::dup(Fd);
|
||||
|
||||
|
@ -113,5 +113,8 @@ int main( int argc, char **argv ) {
|
||||
client->BeginSourceFile(CI->getLangOpts(), &CI->getPreprocessor());
|
||||
}
|
||||
|
||||
// Only for test/OutputRedirect.C, but shouldn't affect performance too much.
|
||||
::fflush(stdout);
|
||||
::fflush(stderr);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user