]> granicus.if.org Git - postgresql/commit
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:36:06 +0000 (19:36 -0400)
commit4b2669ada6cb03c08eba21013321c8b2b412eaa1
tree944af4ffefdf06e3e1b300d53cd0ad136871a433
parent166dfb3a903eee25637b846a87a4a63c67d5e796
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