summaryrefslogtreecommitdiff
path: root/ctdb/client
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2015-11-11 14:18:51 +1100
committerMartin Schwenke <martins@samba.org>2015-11-16 00:46:14 +0100
commit848da801527828979751c0c42b701bd99ff674e1 (patch)
tree448b399fe45b77633b69d1556829052518c04ed5 /ctdb/client
parenteee4af5c76be9b8ab0cee4e0721eeb438d0a8f5d (diff)
downloadsamba-848da801527828979751c0c42b701bd99ff674e1.tar.gz
ctdb-daemon: Move switch_from_server_to_client() to ctdb_daemon.c
This function can only called from ctdb daemon. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'ctdb/client')
-rw-r--r--ctdb/client/ctdb_client.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index c655ffd9eb4..f9686cca659 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -4388,38 +4388,6 @@ int ctdb_ctrl_recd_ping(struct ctdb_context *ctdb)
return 0;
}
-/* When forking the main daemon and the child process needs to connect
- * back to the daemon as a client process, this function can be used
- * to change the ctdb context from daemon into client mode. The child
- * process must be created using ctdb_fork() and not fork() -
- * ctdb_fork() does some necessary housekeeping.
- */
-int switch_from_server_to_client(struct ctdb_context *ctdb, const char *fmt, ...)
-{
- int ret;
- va_list ap;
-
- /* Add extra information so we can identify this in the logs */
- va_start(ap, fmt);
- debug_extra = talloc_strdup_append(talloc_vasprintf(NULL, fmt, ap), ":");
- va_end(ap);
-
- /* get a new event context */
- ctdb->ev = tevent_context_init(ctdb);
- tevent_loop_allow_nesting(ctdb->ev);
-
- /* Connect to main CTDB daemon */
- ret = ctdb_socket_connect(ctdb);
- if (ret != 0) {
- DEBUG(DEBUG_ALERT, (__location__ " Failed to init ctdb client\n"));
- return -1;
- }
-
- ctdb->can_send_controls = true;
-
- return 0;
-}
-
/*
get the status of running the monitor eventscripts: NULL means never run.
*/