summaryrefslogtreecommitdiff
path: root/libprocessgroup/task_profiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libprocessgroup/task_profiles.cpp')
-rw-r--r--libprocessgroup/task_profiles.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libprocessgroup/task_profiles.cpp b/libprocessgroup/task_profiles.cpp
index 8d4ce2545..f13a6815c 100644
--- a/libprocessgroup/task_profiles.cpp
+++ b/libprocessgroup/task_profiles.cpp
@@ -425,10 +425,12 @@ bool TaskProfiles::Load(const CgroupMap& cg_map, const std::string& file_name) {
return false;
}
- Json::Reader reader;
+ Json::CharReaderBuilder builder;
+ std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
Json::Value root;
- if (!reader.parse(json_doc, root)) {
- LOG(ERROR) << "Failed to parse task profiles: " << reader.getFormattedErrorMessages();
+ std::string errorMessage;
+ if (!reader->parse(&*json_doc.begin(), &*json_doc.end(), &root, &errorMessage)) {
+ LOG(ERROR) << "Failed to parse task profiles: " << errorMessage;
return false;
}