From 905065f8c8dd4459f843fc8eb5faa87b64e42b2e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 7 Sep 2021 18:21:37 +0200 Subject: Kernel: Make PerformanceEventBuffer::to_json() return a KResult There's a ton of things inside to_json() that could go wrong but we don't know about it yet. One step at a time. --- Kernel/Process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Kernel/Process.cpp') diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index a1ce03fe9d..fb512ea546 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -581,7 +581,7 @@ bool Process::dump_perfcore() return false; } auto builder = builder_or_error.release_value(); - if (!m_perf_event_buffer->to_json(builder)) { + if (m_perf_event_buffer->to_json(builder).is_error()) { dbgln("Failed to generate perfcore for pid {}: Could not serialize performance events to JSON.", pid().value()); return false; } -- cgit v1.2.3