summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/process.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-07 12:53:28 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-07 13:53:14 +0200
commit55b0b06897b7160b5fbc18ff9186a2242bbdf318 (patch)
tree02ba4614e201ed5ca777e9de392c30e1ed8b935e /Kernel/Syscalls/process.cpp
parentdb2e67fd53facb5120f565bff761abf9a6d99cb6 (diff)
downloadserenity-55b0b06897b7160b5fbc18ff9186a2242bbdf318.zip
Kernel: Store process names as KString
Diffstat (limited to 'Kernel/Syscalls/process.cpp')
-rw-r--r--Kernel/Syscalls/process.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Kernel/Syscalls/process.cpp b/Kernel/Syscalls/process.cpp
index ea0a660a31..f2301b4129 100644
--- a/Kernel/Syscalls/process.cpp
+++ b/Kernel/Syscalls/process.cpp
@@ -27,10 +27,10 @@ KResultOr<FlatPtr> Process::sys$get_process_name(Userspace<char*> buffer, size_t
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(stdio);
- if (m_name.length() + 1 > buffer_size)
+ if (m_name->length() + 1 > buffer_size)
return ENAMETOOLONG;
- return copy_to_user(buffer, m_name.characters(), m_name.length() + 1);
+ return copy_to_user(buffer, m_name->characters(), m_name->length() + 1);
}
KResultOr<FlatPtr> Process::sys$set_process_name(Userspace<const char*> user_name, size_t user_name_length)
@@ -43,8 +43,7 @@ KResultOr<FlatPtr> Process::sys$set_process_name(Userspace<const char*> user_nam
// Empty and whitespace-only names only exist to confuse users.
if (name->view().is_whitespace())
return EINVAL;
- // FIXME: There's a String copy here. Process::m_name should be a KString.
- m_name = name->view();
+ m_name = move(name);
return 0;
}