Fix pg_file_write() error handling.
authorNoah Misch <noah@leadboat.com>
Sun, 12 Mar 2017 23:35:31 +0000 (19:35 -0400)
committerNoah Misch <noah@leadboat.com>
Sun, 12 Mar 2017 23:35:31 +0000 (19:35 -0400)
commit944a026b4ec252667f275768ba4dcd53ae3bb07e
tree36c5c6d3c8710cd7f288666b17d41bd68e5600c9
parent2fd26b23b662dcb0cf649e983a58581cb911fc4b
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).
contrib/adminpack/adminpack.c