瀏覽代碼

Kernel: Make CoreDump::m_num_program_headers const

This makes it an error to assign to it after construction.
Andreas Kling 4 年之前
父節點
當前提交
28c042e46f
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Kernel/CoreDump.h
  2. 1 1
      Kernel/Syscalls/profiling.cpp

+ 1 - 1
Kernel/CoreDump.h

@@ -59,7 +59,7 @@ private:
 
     Process& m_process;
     NonnullRefPtr<FileDescription> m_fd;
-    size_t m_num_program_headers;
+    const size_t m_num_program_headers;
 };
 
 }

+ 1 - 1
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;
 }