Re: pgbench on mingw needs fflush

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, ishii(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: pgbench on mingw needs fflush
Date: 2007-03-20 17:47:36
Message-ID: 200703201747.l2KHlaT07332@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Magnus Hagander wrote:
> On Tue, Mar 13, 2007 at 05:09:15PM +0900, ITAGAKI Takahiro wrote:
> >
> > Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> 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.
>
> I was just going to suggest this, because this is what we already use in
> the backend (src/backend/main/main.c).
>
> Applied, but with the #ifdefs, because that's cleaner and that's also
> how we do it in the backend.

And the #ifdef documents we need it only on Win32. Without it, someone
might remove it thinking Unix doesn't need it.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2007-03-20 18:20:45 Make CLUSTER MVCC-safe
Previous Message Bruce Momjian 2007-03-20 16:39:14 Re: Fix race condition in size functions