[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Berkeley DB Win32 problems.

From: <cmpilato_at_collab.net>
Date: 2001-08-23 18:17:36 CEST

cmpilato@collab.net writes:

> Attached to this mail is a patch for one of the Sleepycat's C example
> programs that, I think, demonstrates the problems we have with BDB
> under Win98 (see Issue #384).

Actually, what was attached to that mail was a broken patch. Let me
try this again:

--- ex_env.c Sat Oct 28 09:57:46 2000
+++ ex_env.c.new Thu Aug 23 11:10:07 2001
@@ -37,7 +37,7 @@
 #endif
 #endif
 
-int db_setup __P((char *, char *, FILE *, char *));
+int db_setup __P((char *, char *, FILE *, char *, int));
 int db_teardown __P((char *, char *, FILE *, char *));
 #ifdef HAVE_VXWORKS
 int ex_env __P((void));
@@ -70,7 +70,11 @@
         data_dir = CONFIG_DATA_DIR;
 
         printf("Setup env\n");
- if ((ret = db_setup(home, data_dir, stderr, progname)) != 0)
+ if ((ret = db_setup(home, data_dir, stderr, progname, 1)) != 0)
+ return (ret);
+
+ printf("Re-open env\n");
+ if ((ret = db_setup(home, data_dir, stderr, progname, 0)) != 0)
                 return (ret);
 
         printf("Teardown env\n");
@@ -81,9 +85,10 @@
 }
 
 int
-db_setup(home, data_dir, errfp, progname)
+db_setup(home, data_dir, errfp, progname, create)
         char *home, *data_dir, *progname;
         FILE *errfp;
+ int create;
 {
         DB_ENV *dbenv;
         int ret;
@@ -122,7 +127,7 @@
 
         /* Open the environment with full transactional support. */
         if ((ret = dbenv->open(dbenv, home,
- DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN,
+ (create ? DB_CREATE : 0) | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN,
             0)) != 0) {
                 dbenv->err(dbenv, ret, "environment open: %s", home);
                 dbenv->close(dbenv, 0);

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:36 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.