Re: pgbench on mingw needs fflush - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: pgbench on mingw needs fflush
Date
Msg-id 200703201747.l2KHlaT07332@momjian.us
Whole thread Raw
In response to Re: pgbench on mingw needs fflush  (Magnus Hagander <magnus@hagander.net>)
List pgsql-patches
Magnus Hagander wrote:
> On Tue, Mar 13, 2007 at 05:09:15PM +0900, ITAGAKI Takahiro wrote:
> >
> > Tatsuo Ishii <ishii@sraoss.co.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@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Fix race condition in size functions
Next
From: Heikki Linnakangas
Date:
Subject: Make CLUSTER MVCC-safe