summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2005-06-19 21:34:03 +0000
committerTom Lane2005-06-19 21:34:03 +0000
commit3f749924f82efd5b2f4b424f6c69a89a2959e4b3 (patch)
tree3bd4c6588dc45f0b88f394e0dee85f201f54d4d0 /src/include
parente26b0abda3919448d5ccbcaac0415010022864b7 (diff)
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.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/fd.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h
index 20c2c64c898..0cebfb85bb2 100644
--- a/src/include/storage/fd.h
+++ b/src/include/storage/fd.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/fd.h,v 1.51 2005/05/20 14:53:26 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/fd.h,v 1.52 2005/06/19 21:34:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -76,6 +76,7 @@ extern int FreeFile(FILE *file);
/* Operations to allow use of the <dirent.h> library routines */
extern DIR *AllocateDir(const char *dirname);
+extern struct dirent *ReadDir(DIR *dir, const char *dirname);
extern int FreeDir(DIR *dir);
/* If you've really really gotta have a plain kernel FD, use this */