summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap.c
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2008-01-16 12:09:48 +0300
committerAlexander Bokovoy <ab@samba.org>2008-01-16 12:09:48 +0300
commit68694369fc96354452979b07425f3f48c4f73bbe (patch)
tree6f4f9870ad48babe85c26af0b86d143e446a0cfe /source3/lib/dbwrap.c
parentf426949e8861b3a97d321516edbcbd771b7d6273 (diff)
downloadsamba-68694369fc96354452979b07425f3f48c4f73bbe.tar.gz
samba-68694369fc96354452979b07425f3f48c4f73bbe.tar.bz2
samba-68694369fc96354452979b07425f3f48c4f73bbe.zip
Merge CTDB-related fixes from samba-ctdb 3.0 branch (http://samba.org/~tridge/3_0-ctdb)
Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 0c8e23afbbb2d081fc23908bafcad04650bfacea)
Diffstat (limited to 'source3/lib/dbwrap.c')
-rw-r--r--source3/lib/dbwrap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/lib/dbwrap.c b/source3/lib/dbwrap.c
index 4e16d18682..001424a6c0 100644
--- a/source3/lib/dbwrap.c
+++ b/source3/lib/dbwrap.c
@@ -20,7 +20,9 @@
*/
#include "includes.h"
-
+#ifdef CLUSTER_SUPPORT
+#include "ctdb_private.h"
+#endif
/*
* Fall back using fetch_locked if no genuine fetch operation is provided
*/
@@ -46,10 +48,16 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
int open_flags, mode_t mode)
{
struct db_context *result = NULL;
+#ifdef CLUSTER_SUPPORT
+ const char *sockname = lp_ctdbd_socket();
+#endif
#ifdef CLUSTER_SUPPORT
+ if(!sockname || !*sockname) {
+ sockname = CTDB_PATH;
+ }
- if (lp_clustering()) {
+ if (lp_clustering() && socket_exist(sockname)) {
const char *partname;
/* ctdb only wants the file part of the name */
partname = strrchr(name, '/');