From 11c025105976994a21c7d10812af01768b6d2a63 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 16 Jan 2017 12:56:33 -0800 Subject: [PATCH] SCP: Make sure that log and debug file I/O use a large (64K) buffer --- sim_console.c | 1 + sim_tmxr.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sim_console.c b/sim_console.c index d8cef948..11f55c23 100644 --- a/sim_console.c +++ b/sim_console.c @@ -1860,6 +1860,7 @@ else { *pref = NULL; return SCPE_OPENERR; } + setvbuf (*pf, NULL, _IOFBF, 65536); (*pref)->file = *pf; (*pref)->refcount = 1; /* need close */ } diff --git a/sim_tmxr.c b/sim_tmxr.c index 6bf0ef1f..7dec384a 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -2598,9 +2598,7 @@ while (*tptr) { else strcpy (lp->txlogname, mp->logfiletmpl); r = sim_open_logfile (lp->txlogname, TRUE, &lp->txlog, &lp->txlogref); - if (r == SCPE_OK) - setvbuf (lp->txlog, NULL, _IOFBF, 65536); - else { + if (r != SCPE_OK) { free (lp->txlogname); lp->txlogname = NULL; break;