diff create.cpp @ 591:0242e5d1643c

Address portability issues in database creation Define a getpagesize() macro which returns The Right Thing on WIN32 Use Windows permissions flags in open() with O_CREAT.
author mas01cr
date Tue, 11 Aug 2009 21:42:24 +0000
parents 4eedc18634f5
children 31a1556fc2d6
line wrap: on
line diff
--- a/create.cpp	Tue Aug 11 21:42:18 2009 +0000
+++ b/create.cpp	Tue Aug 11 21:42:24 2009 +0000
@@ -46,7 +46,13 @@
     datadim = ADB_DEFAULT_DATADIM;
   }
 
-  if ((fd = open(path, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0) {
+  if ((fd = open(path, O_RDWR|O_CREAT|O_EXCL, 
+#if defined(WIN32)
+                 _S_IREAD|_S_IWRITE
+#else
+                 S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
+#endif
+                 )) < 0) {
     goto error;
   }