Fix pg_file_write() error handling.

Noah Misch <noah@leadboat.com>

Commit: e03c6d93bfabc6606a8778b253ae31f2c3ee849d
Author: Noah Misch <noah@leadboat.com>
Date: 2017-03-12T23:36:15Z
Releases: 9.3.17
Fix pg_file_write() error handling.

Detect fclose() failures; given "ln -s /dev/full $PGDATA/devfull",
"pg_file_write('devfull', 'x', true)" now fails as it should.  Don't
leak a stream when fwrite() fails.  Remove a born-ineffective test that
aimed to skip zero-length writes.  Back-patch to 9.2 (all supported
versions).

Files

PathChange+/−
contrib/adminpack/adminpack.c modified +7 −12