From 6cc1e660eeb730b30cbd7bc323648444144db904 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 2 Oct 2015 20:42:05 -0700 Subject: [PATCH] lib: Make ctdbd_probe return 0/errno Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/include/ctdbd_conn.h | 2 +- source3/lib/ctdb_dummy.c | 4 ++-- source3/lib/ctdbd_conn.c | 4 ++-- source3/lib/util_cluster.c | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index a42deae7ff4..1381569a5a5 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -91,6 +91,6 @@ int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid, const uint8_t *msg, size_t msglen, void *private_data), void *private_data); -NTSTATUS ctdbd_probe(const char *sockname, int timeout); +int ctdbd_probe(const char *sockname, int timeout); #endif /* _CTDBD_CONN_H */ diff --git a/source3/lib/ctdb_dummy.c b/source3/lib/ctdb_dummy.c index 7afb6b3aabc..c2783eeaaa9 100644 --- a/source3/lib/ctdb_dummy.c +++ b/source3/lib/ctdb_dummy.c @@ -24,9 +24,9 @@ #include "lib/dbwrap/dbwrap_ctdb.h" #include "torture/proto.h" -NTSTATUS ctdbd_probe(const char *sockname, int timeout) +int ctdbd_probe(const char *sockname, int timeout) { - return NT_STATUS_NOT_IMPLEMENTED; + return ENOSYS; } int ctdbd_messaging_send_iov(struct ctdbd_connection *conn, diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 0f5b41e55ac..f091da7b2f0 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -1296,7 +1296,7 @@ int ctdb_unwatch(struct ctdbd_connection *conn) return ret; } -NTSTATUS ctdbd_probe(const char *sockname, int timeout) +int ctdbd_probe(const char *sockname, int timeout) { /* * Do a very early check if ctdbd is around to avoid an abort and core @@ -1313,5 +1313,5 @@ NTSTATUS ctdbd_probe(const char *sockname, int timeout) */ TALLOC_FREE(conn); - return map_nt_error_from_unix(ret); + return ret; } diff --git a/source3/lib/util_cluster.c b/source3/lib/util_cluster.c index 85f006ce2cd..bfa11548337 100644 --- a/source3/lib/util_cluster.c +++ b/source3/lib/util_cluster.c @@ -26,12 +26,12 @@ bool cluster_probe_ok(void) { if (lp_clustering()) { - NTSTATUS status; + int ret; - status = ctdbd_probe(lp_ctdbd_socket(), lp_ctdb_timeout()); - if (!NT_STATUS_IS_OK(status)) { + ret = ctdbd_probe(lp_ctdbd_socket(), lp_ctdb_timeout()); + if (ret != 0) { DEBUG(0, ("clustering=yes but ctdbd connect failed: " - "%s\n", nt_errstr(status))); + "%s\n", strerror(ret))); return false; } } -- 2.11.4.GIT