summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-10-31 22:47:19 -0700
committerAndreas Kling <kling@serenityos.org>2021-11-02 11:34:31 +0100
commit9f6eabd73a76daa0da5521770a28e648523961a7 (patch)
treea2a4e78cb51e5b4a6c41e8abc08c8ee1b5371e13 /Kernel/Syscalls
parent71f05c70b4e1b442ed3bcce712b5dcfb266da996 (diff)
downloadserenity-9f6eabd73a76daa0da5521770a28e648523961a7.zip
Kernel: Move TTY subsystem to use KString instead of `AK::String`
This is minor progress on removing the `AK::String` API from the Kernel in the interest of improving OOM safety.
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/ttyname.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/ttyname.cpp b/Kernel/Syscalls/ttyname.cpp
index ca4df4de74..2e73d06a9c 100644
--- a/Kernel/Syscalls/ttyname.cpp
+++ b/Kernel/Syscalls/ttyname.cpp
@@ -18,7 +18,7 @@ KResultOr<FlatPtr> Process::sys$ttyname(int fd, Userspace<char*> buffer, size_t
auto description = TRY(fds().open_file_description(fd));
if (!description->is_tty())
return ENOTTY;
- auto tty_name = description->tty()->tty_name();
+ auto& tty_name = description->tty()->tty_name();
if (size < tty_name.length() + 1)
return ERANGE;
return copy_to_user(buffer, tty_name.characters(), tty_name.length() + 1);
@@ -32,7 +32,7 @@ KResultOr<FlatPtr> Process::sys$ptsname(int fd, Userspace<char*> buffer, size_t
auto* master_pty = description->master_pty();
if (!master_pty)
return ENOTTY;
- auto pts_name = master_pty->pts_name();
+ auto& pts_name = master_pty->pts_name();
if (size < pts_name.length() + 1)
return ERANGE;
return copy_to_user(buffer, pts_name.characters(), pts_name.length() + 1);