diff options
author | Volker Lendecke <vl@samba.org> | 2008-03-17 14:12:10 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-03-17 14:56:45 +0100 |
commit | 3c02b180d029336fe07a86258c38fe4b47ad5091 (patch) | |
tree | d70c8d386ca86955dbe9f1307edc0ad6954390b7 /source3/lib | |
parent | c82e84862896b9753e63ca5a887639ee6c0137f3 (diff) | |
download | samba-3c02b180d029336fe07a86258c38fe4b47ad5091.tar.gz samba-3c02b180d029336fe07a86258c38fe4b47ad5091.tar.bz2 samba-3c02b180d029336fe07a86258c38fe4b47ad5091.zip |
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)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/ctdbd_conn.c | 7 |
1 files 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))); |