Clean up some copied-and-pasted code in pg_upgrade.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 3864afa1d1478f7a76fde1ea160a7bc8f5d5b203
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-12-11T19:17:46Z
Releases: 9.1.0
Clean up some copied-and-pasted code in pg_upgrade.

1. Don't reimplement S_ISDIR() and S_ISREG() badly.
2. Don't reimplement access() badly.

This code appears to have been copied from ancient versions of the
corresponding backend routines, and not patched to incorporate subsequent
fixes (see my commits of 2008-03-31 and 2010-01-14 respectively).
It might be a good idea to change it to just *call* those routines,
but for now I'll just transpose these fixes over.

Files

PathChange+/−
contrib/pg_upgrade/exec.c modified +5 −64
contrib/pg_upgrade/file.c modified +2 −2