Thread: pgsql: Refactor check_ functions to use filehandle for status

pgsql: Refactor check_ functions to use filehandle for status

From
Daniel Gustafsson
Date:
Refactor check_ functions to use filehandle for status

When reporting failure in check_ functions there is (typically) a text-
file mentioned in the error report which contains further details. Some
check_ functions kept a separate flag variable to indicate failure, and
some just checked the state of the filehandle as it's guaranteed to be
open when the check failed. This refactors the functions to consistently
do the same check on error reporting. As the error report contains the
filepath, it makes more sense to check the filehandle state and skip the
flag variable.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Bruce Momjian <bruce@momjian.us>
Discussion: https://postgr.es/m/595759F6-625B-4ED7-8125-91AF00437F83@yesql.se

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cad4323cd345ec91fbe8d118436d3d50fa53c300

Modified Files
--------------
src/bin/pg_upgrade/check.c    | 30 +++++-------------------------
src/bin/pg_upgrade/function.c |  4 +---
src/bin/pg_upgrade/version.c  |  7 +------
3 files changed, 7 insertions(+), 34 deletions(-)