From 3c02b180d029336fe07a86258c38fe4b47ad5091 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 17 Mar 2008 14:12:10 +0100 Subject: Use right control to attach to persistent databases This is a merge of 2a8f8b26f08ab09c34dff82417e541d8eb1ec91c and 4e6508dfee0d872a7fa42c9e58ba565137a27b3f from 3-0-ctdb (This used to be commit 46e50da0d550e43de3aaf0141c64f25e1c9997c2) --- source3/lib/ctdbd_conn.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 18e9879601..46936c5f39 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -820,13 +820,16 @@ NTSTATUS ctdbd_db_attach(struct ctdbd_connection *conn, 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(conn, CTDB_CURRENT_NODE, - CTDB_CONTROL_DB_ATTACH, 0, data, - NULL, &data, &cstatus); + persistent + ? CTDB_CONTROL_DB_ATTACH_PERSISTENT + : CTDB_CONTROL_DB_ATTACH, + 0, data, NULL, &data, &cstatus); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, (__location__ " ctdb_control for db_attach " "failed: %s\n", nt_errstr(status))); -- cgit