Flush cout after each output line
The default buffering behavior depends on whether the output is connected to an interactive device. This causes output lines to be buffered in an undesirable way when stdout is piped, which is how nix-eval-jobs is normally used. Let's fix it by flushing stdout explicitly.
This commit is contained in:
parent
cc892aeb90
commit
6d61193286
|
@ -404,7 +404,7 @@ int main(int argc, char * * argv)
|
|||
}
|
||||
} else {
|
||||
auto state(state_.lock());
|
||||
std::cout << respString << "\n";
|
||||
std::cout << respString << "\n" << std::flush;
|
||||
}
|
||||
|
||||
/* Add newly discovered job names to the queue. */
|
||||
|
|
Loading…
Reference in a new issue