pgsql: Fix pg_file_write() error handling.

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix pg_file_write() error handling.
Date: 2017-03-12 23:41:40
Message-ID: E1cnD7M-00034d-VH@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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).

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0276da5eb31e9e6bf2d038ec5712b0b378904a70

Modified Files
--------------
contrib/adminpack/adminpack.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2017-03-13 11:11:33 pgsql: Fix typo in comment
Previous Message David Rowley 2017-03-12 21:44:29 Re: pgsql: dblink: Replace some macros by static functions