$OpenBSD: patch-src_common_db_cpp,v 1.3 2007/10/23 11:28:10 steven Exp $ --- src/common/db.cpp.orig Tue Sep 25 10:51:21 2007 +++ src/common/db.cpp Tue Oct 2 11:53:18 2007 @@ -70,6 +70,19 @@ wxChar const *SQL_CATALOG_FILENAME = wxT("catalog. #endif // wxUSE_THREADS #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;