$OpenBSD: patch-src_common_db_cpp,v 1.2 2006/10/12 14:09:33 alek Exp $
--- src/common/db.cpp.orig	Tue Jan 17 12:14:16 2006
+++ src/common/db.cpp	Thu Jun  1 02:33:00 2006
@@ -72,6 +72,19 @@ wxChar const *SQL_CATALOG_FILENAME     =
     extern wxList TablesInUse;
 #endif
 
+#ifndef ___SQLTCHAR
+#define ___SQLTCHAR SQLCHAR
+#endif
+
+FILE*	fopen_create(char *path, char *mode)
+{
+	// Only open the file if it does not already exist
+	int fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0600);
+	if (fd < 0)
+		return NULL;
+	return fdopen(fd, mode);
+}
+
 // SQL Log defaults to be used by GetDbConnection
 wxDbSqlLogState SQLLOGstate = sqlLogOFF;
 
