#include <unistd.h>
#include "include/compat.h"
-#include "global/signal_handler.h"
-
#include "include/types.h"
#include "include/str_list.h"
-#include "common/entity_name.h"
+
#include "common/Clock.h"
-#include "common/signal.h"
+#include "common/HeartbeatMap.h"
+#include "common/Timer.h"
+#include "common/backport14.h"
#include "common/ceph_argparse.h"
+#include "common/config.h"
+#include "common/entity_name.h"
#include "common/errno.h"
+#include "common/perf_counters.h"
+#include "common/signal.h"
#include "common/version.h"
+#include "global/signal_handler.h"
+
#include "msg/Messenger.h"
#include "mon/MonClient.h"
#include "SnapServer.h"
#include "SnapClient.h"
-#include "common/HeartbeatMap.h"
-
-#include "common/perf_counters.h"
-
-#include "common/Timer.h"
-
#include "events/ESession.h"
#include "events/ESubtreeMap.h"
#include "auth/RotatingKeyRing.h"
#include "auth/KeyRing.h"
-#include "common/config.h"
-
#include "perfglue/cpu_profiler.h"
#include "perfglue/heap_profiler.h"
std::stringstream ss;
std::string prefix;
std::string format;
- boost::scoped_ptr<Formatter> f;
+ std::unique_ptr<Formatter> f(Formatter::create(format));
cmd_getval(cct, cmdmap, "prefix", prefix);
int r = 0;
if (prefix == "get_command_descriptions") {
int cmdnum = 0;
- JSONFormatter *f = new JSONFormatter();
+ std::unique_ptr<JSONFormatter> f(ceph::make_unique<JSONFormatter>());
f->open_object_section("command_descriptions");
for (MDSCommand *cp = mds_commands;
cp < &mds_commands[ARRAY_SIZE(mds_commands)]; cp++) {
ostringstream secname;
secname << "cmd" << setfill('0') << std::setw(3) << cmdnum;
- dump_cmddesc_to_json(f, secname.str(), cp->cmdstring, cp->helpstring,
+ dump_cmddesc_to_json(f.get(), secname.str(), cp->cmdstring, cp->helpstring,
cp->module, cp->perm, cp->availability, 0);
cmdnum++;
}
f->close_section(); // command_descriptions
f->flush(ds);
- delete f;
goto out;
}
-
+
cmd_getval(cct, cmdmap, "format", format);
- f.reset(Formatter::create(format));
if (prefix == "version") {
if (f) {
f->open_object_section("version");