Created
August 22, 2016 20:43
-
-
Save cbodley/4551b29c50718c230683a6c1d65b326a to your computer and use it in GitHub Desktop.
CephContext leak test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "common/ceph_argparse.h" | |
#include "common/common_init.h" | |
#include "common/config.h" | |
#include "global/global_init.h" | |
#include "global/global_context.h" | |
int main(int argc, const char** argv) | |
{ | |
std::vector<const char*> args; | |
argv_to_vec(argc, argv, args); | |
env_to_vec(args); | |
const uint32_t module_type = CEPH_ENTITY_TYPE_CLIENT; | |
const code_environment_t env = CODE_ENVIRONMENT_DAEMON; | |
const int flags = CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS; | |
global_init(nullptr, args, module_type, env, flags, "test", true); | |
common_init_finish(g_ceph_context); | |
if (g_conf->daemonize) { | |
global_init_daemonize(g_ceph_context); | |
} | |
g_ceph_context->put(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment