Rev 156: in http://samba.org/~tridge/ctdb
tridge at samba.org
tridge at samba.org
Wed Apr 18 23:58:24 GMT 2007
------------------------------------------------------------
revno: 156
revision-id: tridge at samba.org-20070418235823-f4d1ef1f0f3ac9d6
parent: tridge at samba.org-20070418231425-4902f5acfc663227
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Thu 2007-04-19 09:58:23 +1000
message:
- use separate directories for the tdb files by default
- use TDB_CLEAR_IF_FIRST to ensure we don't use an old tdb
modified:
common/cmdline.c cmdline.c-20070416041216-w1zvz91bkdsgjckw-1
common/ctdb_ltdb.c ctdb_ltdb.c-20061128065342-to93h6eejj5kon81-2
=== modified file 'common/cmdline.c'
--- a/common/cmdline.c 2007-04-18 23:14:25 +0000
+++ b/common/cmdline.c 2007-04-18 23:58:23 +0000
@@ -37,7 +37,7 @@
.transport = "tcp",
.myaddress = NULL,
.self_connect = 0,
- .db_dir = "."
+ .db_dir = NULL
};
=== modified file 'common/ctdb_ltdb.c'
--- a/common/ctdb_ltdb.c 2007-04-18 14:36:22 +0000
+++ b/common/ctdb_ltdb.c 2007-04-18 23:58:23 +0000
@@ -82,6 +82,13 @@
}
}
+ if (mkdir(ctdb->db_directory, 0700) == -1 && errno != EEXIST) {
+ DEBUG(0,(__location__ " Unable to create ctdb directory '%s'\n",
+ ctdb->db_directory));
+ talloc_free(ctdb_db);
+ return NULL;
+ }
+
/* add the node id to the database name, so when we run on loopback
we don't conflict in the local filesystem */
name = talloc_asprintf(ctdb_db, "%s/%s", ctdb->db_directory, name);
@@ -89,7 +96,7 @@
/* when we have a separate daemon this will need to be a real
file, not a TDB_INTERNAL, so the parent can access it to
for ltdb bypass */
- ctdb_db->ltdb = tdb_wrap_open(ctdb, name, 0, TDB_DEFAULT, open_flags, mode);
+ ctdb_db->ltdb = tdb_wrap_open(ctdb, name, 0, TDB_CLEAR_IF_FIRST, open_flags, mode);
if (ctdb_db->ltdb == NULL) {
ctdb_set_error(ctdb, "Failed to open tdb %s\n", name);
talloc_free(ctdb_db);
More information about the samba-cvs
mailing list