summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/process.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Kernel/Syscalls/process.cpp b/Kernel/Syscalls/process.cpp
index 6c2e69cfe9..ea0a660a31 100644
--- a/Kernel/Syscalls/process.cpp
+++ b/Kernel/Syscalls/process.cpp
@@ -39,14 +39,12 @@ KResultOr<FlatPtr> Process::sys$set_process_name(Userspace<const char*> user_nam
REQUIRE_PROMISE(proc);
if (user_name_length > 256)
return ENAMETOOLONG;
- auto name_or_error = try_copy_kstring_from_user(user_name, user_name_length);
- if (name_or_error.is_error())
- return name_or_error.error();
+ auto name = TRY(try_copy_kstring_from_user(user_name, user_name_length));
// Empty and whitespace-only names only exist to confuse users.
- if (name_or_error.value()->view().is_whitespace())
+ if (name->view().is_whitespace())
return EINVAL;
// FIXME: There's a String copy here. Process::m_name should be a KString.
- m_name = name_or_error.value()->view();
+ m_name = name->view();
return 0;
}