From: Karol Mroz Date: Sat, 23 Apr 2016 11:36:01 +0000 (+0200) Subject: global-init: check init flags and set accordingly X-Git-Tag: v10.2.3~139^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f7e6b3cf9c363a3a65da4e176c7324d027352420;p=ceph.git global-init: check init flags and set accordingly If init flags have changed between the time ceph context was instantiated and now, update them. This can happen, for example, if between manual global_pre_init() and global_init() calls, a daemon adds modifies it's init flags. Signed-off-by: Karol Mroz (cherry picked from commit a0ad13db7aba95537808a570ad4c90f6ac4ca0b8) --- diff --git a/src/global/global_init.cc b/src/global/global_init.cc index 9e9d6aa91c8..f91a2d1d0ad 100644 --- a/src/global/global_init.cc +++ b/src/global/global_init.cc @@ -148,6 +148,12 @@ void global_init(std::vector < const char * > *alt_def_args, } first_run = false; + // Verify flags have not changed if global_pre_init() has been called + // manually. If they have, update them. + if (g_ceph_context->get_init_flags() != flags) { + g_ceph_context->set_init_flags(flags); + } + // signal stuff int siglist[] = { SIGPIPE, 0 }; block_signals(siglist, NULL);