From ed9c84aedca910c6111bf5b83633cd2f2c473dff Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Mon, 6 Jun 2022 13:03:14 -0500 Subject: [PATCH] line-buffer stdout to be nice to debug engines Some IDE debug engines start up debug servers in pipes and look for status messages to indicate the debug server is finished starting up. The startup messages could be stuck in the stdio buffer, causing the debug engine to time out. --- src/main.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cc b/src/main.cc index 652c19c..1511814 100644 --- a/src/main.cc +++ b/src/main.cc @@ -583,6 +583,9 @@ int main(int argc, char **argv) if (debugMode) setvbuf(stderr, NULL, _IOLBF, 0); + // Be nicer to debug engines running us through pipes + setvbuf(stdout, NULL, _IOLBF, 0); + int rv = 0; // return value from main() try {