From: Karol Mroz Date: Sat, 23 Apr 2016 11:55:18 +0000 (+0200) Subject: global-init: fixup inconsistent use of ceph ctx and conf X-Git-Tag: v11.0.0~829^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=088cc66a94886130df647976050c9d98fcd7572e;p=ceph.git global-init: fixup inconsistent use of ceph ctx and conf Signed-off-by: Karol Mroz --- diff --git a/src/global/global_init.cc b/src/global/global_init.cc index 4d7addf2918f..38636df404b5 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) &&