aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablespace.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-09-12 15:51:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-09-12 15:51:52 +0000
commit325aeb4a654435cd055c390ea9e28e1e563c7507 (patch)
treea9e4cf1530894f1a23780f7d16ba190bdeabb804 /src/backend/commands/tablespace.c
parent762140f600adc5be28b083addc7a6551ef30aad5 (diff)
downloadpostgresql-325aeb4a654435cd055c390ea9e28e1e563c7507.tar.gz
postgresql-325aeb4a654435cd055c390ea9e28e1e563c7507.zip
Install a hopefully-temporary workaround for Snow Leopard readdir() bug.
If Apple doesn't fix that reasonably soon, we'll have to consider back-patching a workaround; but for now, just hack it in HEAD so that we can get buildfarm reports on HEAD from OS X machines. Per Jan Otto.
Diffstat (limited to 'src/backend/commands/tablespace.c')
-rw-r--r--src/backend/commands/tablespace.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index b81381a6ea8..eef2eb61e9f 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.61 2009/01/22 20:16:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.62 2009/09/12 15:51:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -612,6 +612,17 @@ remove_tablespace_directories(Oid tablespaceoid, bool redo)
subfile)));
pfree(subfile);
+
+ /*
+ * OS X 10.6 and 10.6.1 have a bug in readdir() that causes the
+ * next call to fail after deleting the current element. Hopefully
+ * that will be fixed real soon, but for the moment we have this
+ * ugly kluge to restart the directory scan.
+ */
+#ifdef __darwin__
+ FreeDir(dirdesc);
+ dirdesc = AllocateDir(location);
+#endif
}
FreeDir(dirdesc);