Tatsuo Ishii <[EMAIL PROTECTED]> wrote:

> Can we distinguish mingw case from others so that we could ifdef out
> the extra fflush()?
> > The buffered stderr might be a bug of mingw

After a little research, I found that MSDN says the buffered stderr is
a specifications on Windows somehow, not a bug.

setvbuf() is better solution for the problem.
This is more simple and no need to use ifdef.



*** pgbench.c.orig      Mon Jan 22 11:17:30 2007
--- pgbench.c   Tue Mar 13 17:01:12 2007
*************** main(int argc, char **argv)
*** 1184,1189 ****
--- 1184,1192 ----
  
        char            val[64];
  
+       /* stderr is buffered on Win32. */
+       setvbuf(stderr, NULL, _IONBF, 0);
+ 
        if ((env = getenv("PGHOST")) != NULL && *env != '\0')
                pghost = env;
        if ((env = getenv("PGPORT")) != NULL && *env != '\0')

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to