Rev 627: use the right control to attach to persistent databases in http://samba.org/~tridge/3_0-ctdb

tridge at samba.org tridge at samba.org
Fri Sep 21 06:57:49 GMT 2007


------------------------------------------------------------
revno: 627
revision-id: tridge at samba.org-20070921065748-dmgohsxef8841rc4
parent: tridge at samba.org-20070921065728-1a1mlz4oqsh332f7
committer: Andrew Tridgell <tridge at samba.org>
branch nick: s3-ctdb-tridge
timestamp: Fri 2007-09-21 16:57:48 +1000
message:
  use the right control to attach to persistent databases
modified:
  source/lib/messages.c          messages.c-20070210173807-1wjifrbwaz6xnmgl-491
=== modified file 'source/lib/messages.c'
--- a/source/lib/messages.c	2007-09-21 06:04:09 +0000
+++ b/source/lib/messages.c	2007-09-21 06:57:48 +0000
@@ -1858,11 +1858,14 @@
 	NTSTATUS status;
 	TDB_DATA data;
 	int32_t cstatus;
+	bool persistent = (tdb_flags & TDB_CLEAR_IF_FIRST) == 0;
 
 	data.dptr = (uint8_t*)name;
 	data.dsize = strlen(name)+1;
 
-	status = ctdbd_control(ctdbd_ctx, CTDB_CURRENT_NODE, CTDB_CONTROL_DB_ATTACH, 0, data, 
+	status = ctdbd_control(ctdbd_ctx, CTDB_CURRENT_NODE, 
+			       persistent?CTDB_CONTROL_DB_ATTACH:CTDB_CONTROL_DB_ATTACH_PERSISTENT, 
+			       0, data, 
 			       NULL, &data, &cstatus);
 	if (!NT_STATUS_IS_OK(status)
 	    || cstatus != 0



More information about the samba-cvs mailing list