From 088cc66a94886130df647976050c9d98fcd7572e Mon Sep 17 00:00:00 2001 From: Karol Mroz Date: Sat, 23 Apr 2016 13:55:18 +0200 Subject: [PATCH] global-init: fixup inconsistent use of ceph ctx and conf Signed-off-by: Karol Mroz --- src/global/global_init.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/global/global_init.cc b/src/global/global_init.cc index 4d7addf2918f6..38636df404b53 100644 --- a/src/global/global_init.cc +++ b/src/global/global_init.cc @@ -336,7 +336,7 @@ int global_init_prefork(CephContext *cct) const md_config_t *conf = cct->_conf; if (!conf->daemonize) { - if (pidfile_write(g_conf) < 0) + if (pidfile_write(conf) < 0) exit(1); if ((cct->get_init_flags() & CINIT_FLAG_DEFER_DROP_PRIVILEGES) && @@ -349,8 +349,8 @@ int global_init_prefork(CephContext *cct) } // stop log thread - g_ceph_context->_log->flush(); - g_ceph_context->_log->stop(); + cct->_log->flush(); + cct->_log->stop(); return 0; } @@ -378,7 +378,7 @@ void global_init_daemonize(CephContext *cct) void global_init_postfork_start(CephContext *cct) { // restart log thread - g_ceph_context->_log->start(); + cct->_log->start(); /* This is the old trick where we make file descriptors 0, 1, and possibly 2 * point to /dev/null. @@ -403,7 +403,8 @@ void global_init_postfork_start(CephContext *cct) exit(1); } - if (pidfile_write(g_conf) < 0) + const md_config_t *conf = cct->_conf; + if (pidfile_write(conf) < 0) exit(1); if ((cct->get_init_flags() & CINIT_FLAG_DEFER_DROP_PRIVILEGES) && -- 2.39.5