From 6dbcda6026156b41eb6a22065ebcdafbaa47a2f3 Mon Sep 17 00:00:00 2001 From: MatAtBread Date: Sun, 7 Apr 2019 19:13:18 +0100 Subject: [PATCH] Set unbuffered mode for *nix systems stdout, allowing interactive use within spawned processes. Fixes issue #898 --- src/vpncmd/vpncmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vpncmd/vpncmd.c b/src/vpncmd/vpncmd.c index 81df901d..17fa3b1f 100644 --- a/src/vpncmd/vpncmd.c +++ b/src/vpncmd/vpncmd.c @@ -35,6 +35,9 @@ int main(int argc, char *argv[]) #ifdef OS_WIN32 SetConsoleTitleA(CEDAR_PRODUCT_STR " VPN Command Line Utility"); +#else + // For *nix, disable output buffering to allow for interactive use + setbuf(stdout,NULL); #endif // OS_WIN32 #if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG".