Re: fd.c: flush data problems on osx

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Stas Kelvich <s(dot)kelvich(at)postgrespro(dot)ru>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fd.c: flush data problems on osx
Date: 2016-04-13 21:44:41
Message-ID: 27703.1460583881@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> I'm not entirely sure what

> + /*
> + * Caution: do not call pg_flush_data with amount = 0, it could trash the
> + * file's seek position.
> + */
> + if (amount <= 0)
> + return;
> +

> is about?

fd.c tracks seek position for open files. I'm not sure that that
function can get called with amount == 0, but if it did, the caller
would certainly not be expecting the file position to change.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-04-13 21:48:19 Re: fd.c: flush data problems on osx
Previous Message Andres Freund 2016-04-13 21:36:02 Re: fd.c: flush data problems on osx