Re: Safeguards against incorrect fd flags for fsync()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Mark Dilger <hornschnorter@gmail.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-11-25T07:18:33Z
Lists: pgsql-hackers
On Sun, Nov 24, 2019 at 08:18:38PM -0800, Mark Dilger wrote:
> Ok, it passes all regression tests, and I played around with
> intentionally breaking the code to open file descriptors in
> the wrong mode.  The assertion appears to work as intended.
> 
> I'd say this is ready for commit.

Thanks for the review.  I'll look at that pretty soon.
--
Michael

Commits

  1. Make safeguard against incorrect flags for fsync more portable.

  2. Add safeguards for pg_fsync() called with incorrectly-opened fds