Simplify uses of readdir() by creating a function ReadDir() that
Tom Lane <tgl@sss.pgh.pa.us>
Simplify uses of readdir() by creating a function ReadDir() that includes error checking and an appropriate ereport(ERROR) message. This gets rid of rather tedious and error-prone manipulation of errno, as well as a Windows-specific bug workaround, at more than a dozen call sites. After an idea in a recent patch by Heikki Linnakangas.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/dbsize/dbsize.c | modified | +4 −15 |
| src/backend/access/transam/slru.c | modified | +2 −23 |
| src/backend/access/transam/twophase.c | modified | +3 −50 |
| src/backend/access/transam/xlog.c | modified | +3 −33 |
| src/backend/commands/tablespace.c | modified | +4 −47 |
| src/backend/postmaster/pgarch.c | modified | +2 −19 |
| src/backend/storage/file/fd.c | modified | +56 −9 |
| src/backend/utils/adt/misc.c | modified | +4 −8 |
| src/include/storage/fd.h | modified | +2 −1 |
| src/timezone/pgtz.c | modified | +8 −18 |