Properly check for readdir/closedir() failures
Bruce Momjian <bruce@momjian.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_archivecleanup/pg_archivecleanup.c | modified | +14 −2 |
| contrib/pg_standby/pg_standby.c | modified | +15 −2 |
| contrib/pg_upgrade/file.c | modified | +24 −4 |
| src/backend/storage/file/fd.c | modified | +1 −5 |
| src/bin/initdb/initdb.c | modified | +3 −9 |
| src/bin/pg_resetxlog/pg_resetxlog.c | modified | +33 −30 |
| src/port/dirent.c | modified | +6 −2 |
| src/port/dirmod.c | modified | +13 −9 |