psqlodbc.git / summary / log / commit / refs

commit    143b7d948122da45fa72c810f7f4d9ff02ddb1ea
Author:   Hiroshi Inoue <h-inoue@dream.email.ne.jp>
Date:     Fri Oct 26 05:15:22 2018 +0000

    Unbuffered-IO in Windows is incredibly slow. Instead call fflush() after fprintf().


mylog.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mylog.c b/mylog.c index a937800b..9377ad2c 100644 --- a/mylog.c +++ b/mylog.c @@ -304,7 +304,6 @@ static void MLOG_open() } if (MLOGFP) { - setbuf(MLOGFP, NULL); if (open_error) fputs(errbuf, MLOGFP); } @@ -349,6 +348,7 @@ mylog_misc(unsigned int option, const char *fmt, va_list args) #endif /* POSIX_MULTITHREAD_SUPPORT */ } vfprintf(MLOGFP, fmt, args); + fflush(MLOGFP); } // va_end(args); @@ -427,9 +427,7 @@ qlog_misc(unsigned int option, const char *fmt, va_list args) generate_homefile(QLOGFILE, filebuf, sizeof(filebuf)); QLOGFP = fopen(filebuf, PG_BINARY_A); } - if (QLOGFP) - setbuf(QLOGFP, NULL); - else + if (!QLOGFP) qlog_on = 0; } @@ -443,6 +441,7 @@ qlog_misc(unsigned int option, const char *fmt, va_list args) #endif /* LOGGING_PROCESS_TIME */ } vfprintf(QLOGFP, fmt, args); + fflush(QLOGFP); } LEAVE_QLOG_CS; [parent: 61b67b9b98c4]