Fix pg_recvlogical not to fsync output when it's a tty or pipe.

Andres Freund <andres@anarazel.de>

Commit: 8022b0a35f7c4e71908a878c8c412b5c2ae8536c
Author: Andres Freund <andres@anarazel.de>
Date: 2015-07-07T11:07:34Z
Releases: 9.5.0
Fix pg_recvlogical not to fsync output when it's a tty or pipe.

The previous coding tried to handle possible failures when fsyncing a
tty or pipe fd by accepting EINVAL - but apparently some
platforms (windows, OSX) don't reliably return that. So instead check
whether the output fd refers to a pipe or a tty when opening it.

Reported-By: Olivier Gosseaume, Marko Tiikkaja
Discussion: 559AF98B.3050901@joh.to

Backpatch to 9.4, where pg_recvlogical was added.

Files

PathChange+/−
src/bin/pg_basebackup/pg_recvlogical.c modified +15 −2