about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shared.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared.cc b/src/shared.cc
index 32e8916175a7..dcda0b50abe6 100644
--- a/src/shared.cc
+++ b/src/shared.cc
@@ -53,6 +53,10 @@ int main(int argc, char * * argv)
     ATerm bottomOfStack;
     ATinit(argc, argv, &bottomOfStack);
 
+    /* Turn on buffering for cerr. */
+    char buf[1024];
+    cerr.rdbuf()->pubsetbuf(buf, sizeof(buf));
+
     try {
         initAndRun(argc, argv);
     } catch (UsageError & e) {