Thread: pgsql: Properly check for readdir/closedir() failures

pgsql: Properly check for readdir/closedir() failures

From
Bruce Momjian
Date:
Properly check for readdir/closedir() failures

Clear errno before calling readdir() and handle old MinGW errno bug
while adding full test coverage for readdir/closedir failures.

Backpatch through 8.4.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4859a710ea9b26e38a9637301f1259f6123e4de7

Modified Files
--------------
contrib/pg_archivecleanup/pg_archivecleanup.c |   16 ++++++-
contrib/pg_standby/pg_standby.c               |   17 ++++++-
contrib/pg_upgrade/file.c                     |   28 +++++++++--
src/backend/storage/file/fd.c                 |    6 +--
src/bin/initdb/initdb.c                       |   12 ++---
src/bin/pg_resetxlog/pg_resetxlog.c           |   63 +++++++++++++------------
src/port/dirent.c                             |    8 +++-
src/port/dirmod.c                             |   22 +++++----
8 files changed, 109 insertions(+), 63 deletions(-)