From 28c042e46f16f692f7ec1c4632291fb0153c19e7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 15 Dec 2020 11:18:01 +0100 Subject: [PATCH] Kernel: Make CoreDump::m_num_program_headers const This makes it an error to assign to it after construction. --- Kernel/CoreDump.h | 2 +- Kernel/Syscalls/profiling.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/CoreDump.h b/Kernel/CoreDump.h index ae2fdd38091..2b975a6e254 100644 --- a/Kernel/CoreDump.h +++ b/Kernel/CoreDump.h @@ -59,7 +59,7 @@ private: Process& m_process; NonnullRefPtr m_fd; - size_t m_num_program_headers; + const size_t m_num_program_headers; }; } diff --git a/Kernel/Syscalls/profiling.cpp b/Kernel/Syscalls/profiling.cpp index 47e75366699..d49516c4fdf 100644 --- a/Kernel/Syscalls/profiling.cpp +++ b/Kernel/Syscalls/profiling.cpp @@ -60,7 +60,7 @@ int Process::sys$profiling_disable(pid_t pid) // We explicitly unlock here because we can't hold the lock when writing the coredump VFS lock.unlock(); - auto coredump = CoreDump::create(*process, String::formatted("/tmp/profiler_coredumps/%d", pid)); + auto coredump = CoreDump::create(*process, String::formatted("/tmp/profiler_coredumps/{}", pid)); coredump->write(); return 0; }